Skip to content

Commit 0526330

Browse files
committed
1 parent 812670f commit 0526330

File tree

64 files changed

+140
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+140
-381
lines changed

.phpstan.baseline.neon

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

app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ public function getValidateButton()
7272
$optionsVarName = $this->getJsVariablePrefix() . 'VatParameters';
7373
$beforeHtml = '<script type="text/javascript">var ' . $optionsVarName . ' = ' . $vatValidateOptions
7474
. ';</script>';
75-
$this->_validateButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setData([
75+
76+
/** @var Mage_Adminhtml_Block_Widget_Button $block */
77+
$block = $this->getLayout()->createBlock('adminhtml/widget_button');
78+
$this->_validateButton = $block->setData([
7679
'label' => Mage::helper('customer')->__('Validate VAT Number'),
7780
'before_html' => $beforeHtml,
7881
'onclick' => 'order.validateVat(' . $optionsVarName . ')'

app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getAddressId()
111111
/**
112112
* Return address object
113113
*
114-
* @return Mage_Customer_Model_Address
114+
* @return Mage_Sales_Model_Quote_Address
115115
*/
116116
public function getAddress()
117117
{

app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected function _getExtraJs($element, $tooltipsExist = false)
180180
* Collapsed or expanded fieldset when page loaded?
181181
*
182182
* @param Varien_Data_Form_Element_Abstract $element
183-
* @return int|bool
183+
* @return int|false
184184
*/
185185
protected function _getCollapseState($element)
186186
{

app/code/core/Mage/Adminhtml/Block/Widget/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget
4242
/**
4343
* Collection object
4444
*
45-
* @var Mage_Core_Model_Resource_Db_Collection_Abstract|Varien_Data_Collection_Db|null
45+
* @var Varien_Data_Collection_Db|null
4646
*/
4747
protected $_collection = null;
4848

app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function getOrderItem()
225225
/**
226226
* Retrieve Value HTML
227227
*
228-
* @param Mage_Sales_Model_Order_Item $item
228+
* @param Mage_Sales_Model_Order_Invoice_Item $item
229229
* @return string
230230
*/
231231
public function getValueHtml($item)
@@ -249,13 +249,13 @@ public function getValueHtml($item)
249249
/**
250250
* Can show price info for item
251251
*
252-
* @param Mage_Sales_Model_Order_Item $item
252+
* @param Mage_Sales_Model_Order_Invoice_Item $item
253253
* @return bool
254254
*/
255255
public function canShowPriceInfo($item)
256256
{
257257
if (($item->getOrderItem()->getParentItem() && $this->isChildCalculated())
258-
|| (!$item->getOrderItem()->getParentItem() && !$this->isChildCalculated())
258+
|| (!$item->getOrderItem()->getParentItem() && !$this->isChildCalculated())
259259
) {
260260
return true;
261261
}

app/code/core/Mage/Catalog/Block/Navigation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Mage_Catalog_Block_Navigation extends Mage_Core_Block_Template
2828
/**
2929
* Current category key
3030
*
31-
* @var string
31+
* @var int|string
3232
*/
3333
protected $_currentCategoryKey;
3434

@@ -92,7 +92,7 @@ public function getCacheKeyInfo()
9292
/**
9393
* Get current category key
9494
*
95-
* @return mixed
95+
* @return int|string
9696
*/
9797
public function getCurrenCategoryKey()
9898
{

app/code/core/Mage/Catalog/Block/Product/Abstract.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function getAddToCompareUrl($product)
163163
* Gets minimal sales quantity
164164
*
165165
* @param Mage_Catalog_Model_Product $product
166-
* @return int|null
166+
* @return float|null
167167
*/
168168
public function getMinimalQty($product)
169169
{
@@ -313,7 +313,9 @@ protected function _initReviewsHelperBlock()
313313
return false;
314314
}
315315

316-
$this->_reviewsHelperBlock = $this->getLayout()->createBlock('review/helper');
316+
/** @var Mage_Review_Block_Helper $block */
317+
$block = $this->getLayout()->createBlock('review/helper');
318+
$this->_reviewsHelperBlock = $block;
317319
}
318320

319321
return true;

app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template
7373
/**
7474
* List of available view types
7575
*
76-
* @var string
76+
* @var array
7777
*/
7878
protected $_availableMode = [];
7979

@@ -533,7 +533,7 @@ public function isModeActive($mode)
533533
/**
534534
* Retrieve availables view modes
535535
*
536-
* @return string
536+
* @return array
537537
*/
538538
public function getModes()
539539
{
@@ -548,7 +548,7 @@ public function getModes()
548548
*/
549549
public function setModes($modes)
550550
{
551-
if (!isset($this->_availableMode)) {
551+
if (!$this->_availableMode) {
552552
$this->_availableMode = $modes;
553553
}
554554
return $this;
@@ -647,7 +647,7 @@ public function getDefaultPerPageValue()
647647
}
648648
return Mage::getStoreConfig('catalog/frontend/grid_per_page');
649649
}
650-
return 0;
650+
return '0';
651651
}
652652

653653
/**

app/code/core/Mage/Catalog/Block/Product/New.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract
2424
public const DEFAULT_PRODUCTS_COUNT = 10;
2525

2626
/**
27-
* Products count
27+
* @var int
2828
*/
2929
protected $_productsCount;
3030

app/code/core/Mage/Catalog/Block/Product/Widget/Html/Pager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function getTotalNum()
171171
public function getLastPageNum()
172172
{
173173
if ($this->_lastPage === null) {
174-
$this->_lastPage = ceil($this->getCollectionSize() / $this->getLimit());
174+
$this->_lastPage = (int) ceil($this->getCollectionSize() / $this->getLimit());
175175
if ($this->_lastPage <= 0) {
176176
$this->_lastPage = 1;
177177
}

app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ protected function _prepareLayout()
5252
#[\Override]
5353
public function getItemUrl($product)
5454
{
55-
$helper = Mage::helper('catalog/product');
5655
/** @var Mage_Catalog_Helper_Product $helper */
56+
$helper = Mage::helper('catalog/product');
5757
return $helper->getProductUrl($product);
5858
}
5959
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Mage_Catalog_Helper_Data extends Mage_Core_Helper_Abstract
4040
/**
4141
* Breadcrumb Path cache
4242
*
43-
* @var string|array<string, array<string, string|null>>
43+
* @var array<string, array<string, string|null>>
4444
*/
4545
protected $_categoryPath;
4646

@@ -74,7 +74,7 @@ public function setStoreId($store)
7474
* Return current category path or get it from current category
7575
* and creating array of categories|product paths for breadcrumbs
7676
*
77-
* @return string
77+
* @return array
7878
*/
7979
public function getBreadcrumbPath()
8080
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public function getSkipSaleableCheck()
481481
* Gets minimal sales quantity
482482
*
483483
* @param Mage_Catalog_Model_Product $product
484-
* @return int|null
484+
* @return float|null
485485
*/
486486
public function getMinimalQty($product)
487487
{

app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ protected function _getTierPrices()
370370

371371
/**
372372
* Default implementation. May be different for customer/guest/admin role.
373+
*
374+
* @return int|null
373375
*/
374376
protected function _getCustomerGroupId()
375377
{

app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ protected function _filterStockData(&$stockData)
356356
* Filter out fields if Use Config Settings option used
357357
*
358358
* @param array $data
359-
* @param string $fields
359+
* @param array $fields
360360
*/
361361
protected function _filterConfigValueUsed(&$data, $fields)
362362
{

app/code/core/Mage/Catalog/Model/Category/Url.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ protected function _getRequestPath(Mage_Catalog_Model_Category $category)
118118
public function getUrlInstance()
119119
{
120120
if ($this->_url === null) {
121-
$this->_url = $this->_factory->getModel('core/url');
121+
/** @var Mage_Core_Model_Url $model */
122+
$model = $this->_factory->getModel('core/url');
123+
$this->_url = $model;
122124
}
123125
return $this->_url;
124126
}

app/code/core/Mage/Catalog/Model/Design.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function _apply($package, $theme)
7272
* Apply custom design
7373
*
7474
* @param string $design
75-
* @return null|false
75+
* @return void|false
7676
*/
7777
public function applyCustomDesign($design)
7878
{

app/code/core/Mage/Catalog/Model/Factory.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ class Mage_Catalog_Model_Factory extends Mage_Core_Model_Factory
4242
*/
4343
public function getCategoryUrlRewriteHelper()
4444
{
45-
return $this->getHelper(
45+
/** @var Mage_Catalog_Helper_Category_Url_Rewrite_Interface $model */
46+
$model = $this->getHelper(
4647
(string)$this->_config->getNode(self::XML_PATH_CATEGORY_URL_REWRITE_HELPER_CLASS)
4748
);
49+
return $model;
4850
}
4951

5052
/**
@@ -54,9 +56,11 @@ public function getCategoryUrlRewriteHelper()
5456
*/
5557
public function getProductUrlRewriteHelper()
5658
{
57-
return $this->getHelper(
59+
/** @var Mage_Catalog_Helper_Product_Url_Rewrite_Interface $model */
60+
$model = $this->getHelper(
5861
(string)$this->_config->getNode(self::XML_PATH_PRODUCT_URL_REWRITE_HELPER_CLASS)
5962
);
63+
return $model;
6064
}
6165

6266
/**
@@ -66,9 +70,11 @@ public function getProductUrlRewriteHelper()
6670
*/
6771
public function getProductUrlInstance()
6872
{
69-
return $this->getModel(
73+
/** @var Mage_Catalog_Model_Product_Url $model */
74+
$model = $this->getModel(
7075
(string)$this->_config->getNode(self::XML_PATH_PRODUCT_URL_MODEL)
7176
);
77+
return $model;
7278
}
7379

7480
/**
@@ -78,8 +84,10 @@ public function getProductUrlInstance()
7884
*/
7985
public function getCategoryUrlInstance()
8086
{
81-
return $this->getModel(
87+
/** @var Mage_Catalog_Model_Category_Url $model */
88+
$model = $this->getModel(
8289
(string)$this->_config->getNode(self::XML_PATH_CATEGORY_URL_MODEL)
8390
);
91+
return $model;
8492
}
8593
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,8 +1888,8 @@ public function addOption(Mage_Catalog_Model_Product_Option $option)
18881888
/**
18891889
* Get option from options array of product by given option id
18901890
*
1891-
* @param int $optionId
1892-
* @return Mage_Catalog_Model_Product_Option | null
1891+
* @param string $optionId
1892+
* @return Mage_Catalog_Model_Product_Option|null
18931893
*/
18941894
public function getOptionById($optionId)
18951895
{
@@ -1987,7 +1987,7 @@ public function hasCustomOptions()
19871987
* Check availability display product in category
19881988
*
19891989
* @param int $categoryId
1990-
* @return bool
1990+
* @return string
19911991
*/
19921992
public function canBeShowInCategory($categoryId)
19931993
{

app/code/core/Mage/Catalog/Model/Product/Api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public function delete($productId, $identifierType = null)
379379
/**
380380
* Get list of additional attributes which are not in default create/update list
381381
*
382-
* @param int $productType
382+
* @param string $productType
383383
* @param int $attributeSetId
384384
* @return array
385385
*/
@@ -424,7 +424,7 @@ public function getAdditionalAttributes($productType, $attributeSetId)
424424
/**
425425
* Check if product type exists
426426
*
427-
* @param int $productType
427+
* @param string $productType
428428
* @throw Mage_Api_Exception
429429
*/
430430
protected function _checkProductTypeExists($productType)

app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected function _calcSelectionPrice($priceInfo, $productPrice)
110110
/**
111111
* @param array $values
112112
* @param string $index
113-
* @return bool
113+
* @return array|false
114114
*/
115115
protected function _getValueByIndex($values, $index)
116116
{

app/code/core/Mage/Catalog/Model/Resource/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function deleteEntity(Mage_Core_Model_Abstract $object)
112112
* Defines is Attribute used by super products
113113
*
114114
* @param int $attributeSet
115-
* @return int
115+
* @return false|string|null
116116
*/
117117
public function isUsedBySuperProducts(Mage_Core_Model_Abstract $object, $attributeSet = null)
118118
{

app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @package Mage_Catalog
1818
*
1919
* @method Mage_Catalog_Model_Category getFirstItem()
20-
* @method Mage_Catalog_Model_Category getItemById(int $value)
20+
* @method Mage_Catalog_Model_Category getItemById(string $value)
2121
* @method Mage_Catalog_Model_Category[] getItems()
2222
*/
2323
class Mage_Catalog_Model_Resource_Category_Collection extends Mage_Catalog_Model_Resource_Collection_Abstract

app/code/core/Mage/Catalog/Model/Resource/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public function refreshIndex($product)
354354
* if product parameter is null - idex will be refreshed for all products
355355
*
356356
* @param Mage_Core_Model_Store $store
357-
* @param Mage_Catalog_Model_Product $product
357+
* @param Mage_Catalog_Model_Product|array $product
358358
* @throws Mage_Core_Exception
359359
* @return $this
360360
*/

app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function loadByProduct(Mage_Catalog_Model_Product_Compare_Item $object, $
6464
*
6565
* @param int $customerId
6666
* @param int $visitorId
67-
* @return int
67+
* @return false|string|null
6868
*/
6969
public function getCount($customerId, $visitorId)
7070
{

app/code/core/Mage/Catalog/Model/Resource/Setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ protected function _getCategoryEntityRow($entityId)
889889
*
890890
* @param array $category
891891
* @param array $path
892-
* @return string
892+
* @return array
893893
*/
894894
protected function _getCategoryPath($category, $path = [])
895895
{

app/code/core/Mage/Catalog/Model/Resource/Url.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function checkRequestPaths($paths, $storeId)
222222
* Prepare rewrites for condition
223223
*
224224
* @param int $storeId
225-
* @param int|array $categoryIds
225+
* @param int|string|array|false $categoryIds
226226
* @param int|array $productIds
227227
* @return array
228228
*/
@@ -560,7 +560,7 @@ public function saveProductAttribute(Varien_Object $product, $attributeCode, $ig
560560
*
561561
* @param string $attributeCode
562562
* @param int|array $productIds
563-
* @param string $storeId
563+
* @param int|string $storeId
564564
* @return array
565565
*/
566566
public function _getProductAttribute($attributeCode, $productIds, $storeId)

0 commit comments

Comments
 (0)