Skip to content

Commit 1231093

Browse files
committed
update
1 parent d57c34d commit 1231093

File tree

24 files changed

+230
-368
lines changed

24 files changed

+230
-368
lines changed

.phpstan.dist.baseline.neon

Lines changed: 0 additions & 282 deletions
Large diffs are not rendered by default.

app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public function setEntity(Varien_Object $entity)
107107
public function getEntity()
108108
{
109109
if (is_null($this->_entity)) {
110-
$this->setEntity(Mage::getModel('giftmessage/message')->getEntityModelByType('order'));
110+
/** @var Mage_Sales_Model_Order $model */
111+
$model = Mage::getModel('giftmessage/message')->getEntityModelByType('order');
112+
$this->setEntity($model);
111113
$this->getEntity()->load($this->getRequest()->getParam('entity'));
112114
}
113115

app/code/core/Mage/Bundle/Model/Product/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ public function getSelectionFinalPrice(
541541
*
542542
* @param Mage_Catalog_Model_Product $bundleProduct
543543
* @param Mage_Catalog_Model_Product $selectionProduct
544-
* @param float $bundleQty
544+
* @param float|int $bundleQty
545545
* @param null|float $selectionQty
546546
* @param bool $multiplyQty
547547
* @param bool $takeTierPrice

app/code/core/Mage/Catalog/Block/Product/View/Attributes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function getProduct()
3333
* exclude them from additional data array
3434
*
3535
* @return array
36+
* @throws Mage_Core_Model_Store_Exception
3637
*/
3738
public function getAdditionalData(array $excludeAttr = [])
3839
{
@@ -48,7 +49,7 @@ public function getAdditionalData(array $excludeAttr = [])
4849
} elseif (is_null($value) || $value === false || $value === '') {
4950
$value = Mage::helper('catalog')->__('No');
5051
} elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
51-
$value = Mage::app()->getStore()->convertPrice($value, true);
52+
$value = Mage::app()->getStore()->convertPrice((float) $value, true);
5253
}
5354

5455
if (is_string($value) && strlen($value)) {

app/code/core/Mage/Catalog/Block/Widget/Link.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class Mage_Catalog_Block_Widget_Link extends Mage_Core_Block_Html_Link implement
4242
* or return false if path was not found.
4343
*
4444
* @return false|string
45+
* @throws Mage_Core_Exception
46+
* @throws Mage_Core_Model_Store_Exception
4547
*/
4648
public function getHref()
4749
{
@@ -89,6 +91,7 @@ public function getHref()
8991
* If anchor text was not specified get entity name from DB.
9092
*
9193
* @return string
94+
* @throws Mage_Core_Model_Store_Exception
9295
*/
9396
public function getAnchorText()
9497
{
@@ -102,10 +105,10 @@ public function getAnchorText()
102105
if (!$this->_getData('anchor_text')) {
103106
$idPath = explode('/', $this->_getData('id_path'));
104107
if (isset($idPath[1])) {
105-
$id = $idPath[1];
106-
if ($id) {
108+
$entityId = $idPath[1];
109+
if ($entityId) {
107110
$this->_anchorText = $this->_entityResource
108-
->getAttributeRawValue($id, 'name', $store);
111+
->getAttributeRawValue((int) $entityId, 'name', $store);
109112
}
110113
}
111114
} else {

app/code/core/Mage/Catalog/Helper/Data.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function setStoreId($store)
8383
* and creating array of categories|product paths for breadcrumbs
8484
*
8585
* @return array
86+
* @throws Mage_Core_Exception
8687
*/
8788
public function getBreadcrumbPath()
8889
{
@@ -118,8 +119,9 @@ public function getBreadcrumbPath()
118119
/**
119120
* Check is category link
120121
*
121-
* @param int $categoryId
122+
* @param int|string $categoryId
122123
* @return bool
124+
* @throws Mage_Core_Exception
123125
*/
124126
protected function _isCategoryLink($categoryId)
125127
{
@@ -158,6 +160,7 @@ public function getProduct()
158160
* Retrieve Visitor/Customer Last Viewed URL
159161
*
160162
* @return string
163+
* @throws Mage_Core_Exception
161164
*/
162165
public function getLastViewedUrl()
163166
{
@@ -363,9 +366,11 @@ public function getMsrpExplanationMessageWhatsThis()
363366
* in specific visibility
364367
*
365368
* @param int|Mage_Catalog_Model_Product $product
366-
* @param int $visibility Check displaying price in concrete place (by default generally)
369+
* @param Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_* $visibility Check displaying price in concrete place (by default generally)
367370
* @param bool $checkAssociatedItems
368371
* @return bool
372+
* @throws Mage_Core_Exception
373+
* @throws Mage_Core_Model_Store_Exception
369374
*/
370375
public function canApplyMsrp($product, $visibility = null, $checkAssociatedItems = true)
371376
{
@@ -419,6 +424,7 @@ public function canApplyMsrp($product, $visibility = null, $checkAssociatedItems
419424
*
420425
* @param Mage_Catalog_Model_Product $product
421426
* @return bool
427+
* @throws Mage_Core_Exception
422428
*/
423429
public function canApplyMsrpToProductType($product)
424430
{

app/code/core/Mage/Catalog/Helper/Product.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Mage_Catalog_Helper_Product extends Mage_Core_Helper_Url
4747
*
4848
* @param int|Mage_Catalog_Model_Product|string $product
4949
* @return false|string
50+
* @throws Mage_Core_Exception
5051
*/
5152
public function getProductUrl($product)
5253
{
@@ -62,9 +63,10 @@ public function getProductUrl($product)
6263
/**
6364
* Retrieve product view page url including provided category Id
6465
*
65-
* @param int $productId
66-
* @param int $categoryId
66+
* @param int|string $productId
67+
* @param int|string $categoryId
6768
* @return string
69+
* @throws Mage_Core_Exception
6870
*/
6971
public function getFullProductUrl($productId, $categoryId = null)
7072
{
@@ -104,6 +106,7 @@ public function getFinalPrice($product)
104106
*
105107
* @param Mage_Catalog_Model_Product $product
106108
* @return string
109+
* @throws Exception
107110
*/
108111
public function getImageUrl($product)
109112
{
@@ -122,6 +125,8 @@ public function getImageUrl($product)
122125
*
123126
* @param Mage_Catalog_Model_Product $product
124127
* @return string
128+
* @throws Exception
129+
* @throws Mage_Core_Exception
125130
*/
126131
public function getSmallImageUrl($product)
127132
{
@@ -140,6 +145,8 @@ public function getSmallImageUrl($product)
140145
*
141146
* @param Mage_Catalog_Model_Product $product
142147
* @return string
148+
* @throws Exception
149+
* @throws Mage_Core_Exception
143150
*/
144151
public function getThumbnailUrl($product)
145152
{
@@ -156,6 +163,7 @@ public function getThumbnailUrl($product)
156163
/**
157164
* @param Mage_Catalog_Model_Product $product
158165
* @return string
166+
* @throws Mage_Core_Exception
159167
*/
160168
public function getEmailToFriendUrl($product)
161169
{
@@ -188,6 +196,7 @@ public function getStatuses()
188196
* @param int|Mage_Catalog_Model_Product $product
189197
* @param string $where
190198
* @return bool
199+
* @throws Mage_Core_Exception
191200
*/
192201
public function canShow($product, $where = 'catalog')
193202
{
@@ -196,7 +205,6 @@ public function canShow($product, $where = 'catalog')
196205
}
197206

198207
/** @var Mage_Catalog_Model_Product $product */
199-
200208
if (!$product->getId()) {
201209
return false;
202210
}
@@ -209,6 +217,7 @@ public function canShow($product, $where = 'catalog')
209217
*
210218
* @param int $storeId
211219
* @return string
220+
* @throws Mage_Core_Model_Store_Exception
212221
*/
213222
public function getProductUrlSuffix($storeId = null)
214223
{
@@ -308,6 +317,8 @@ public function getAttributeSourceModelByInputType($inputType)
308317
* @param Varien_Object $params
309318
*
310319
* @return false|Mage_Catalog_Model_Product
320+
* @throws Mage_Core_Exception
321+
* @throws Mage_Core_Model_Store_Exception
311322
*/
312323
public function initProduct($productId, $controller, $params = null)
313324
{
@@ -451,6 +462,8 @@ public function addParamsToBuyRequest($buyRequest, $params)
451462
* @param null|int $store
452463
* @param string $identifierType
453464
* @return Mage_Catalog_Model_Product
465+
* @throws Mage_Core_Exception
466+
* @throws Mage_Core_Model_Store_Exception
454467
*/
455468
public function getProduct($productId, $store, $identifierType = null)
456469
{

0 commit comments

Comments
 (0)