Skip to content

Commit f1ae19d

Browse files
build(deps-dev): bump phpstan/phpstan from 2.1.17 to 2.1.18 (#4889)
* build(deps-dev): bump phpstan/phpstan from 2.1.17 to 2.1.18 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 2.1.17 to 2.1.18. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/2.1.x/CHANGELOG.md) - [Commits](phpstan/phpstan@2.1.17...2.1.18) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.1.18 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * fixes * baseline * updated rector - see rectorphp/rector#9268 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sven Reichel <[email protected]>
1 parent d3d2032 commit f1ae19d

File tree

19 files changed

+63
-50
lines changed

19 files changed

+63
-50
lines changed

.phpstan.dist.baseline.neon

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,12 @@ parameters:
19381938
count: 1
19391939
path: app/code/core/Mage/Catalog/Model/Resource/Config.php
19401940

1941+
-
1942+
message: '#^Argument of an invalid type hasOffsetValue\(string, mixed\) supplied for foreach, only iterables are supported\.$#'
1943+
identifier: foreach.nonIterable
1944+
count: 1
1945+
path: app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php
1946+
19411947
-
19421948
message: '#^Binary operation "\-" between int and non\-falsy\-string results in an error\.$#'
19431949
identifier: binaryOp.invalid
@@ -2701,7 +2707,7 @@ parameters:
27012707
path: app/code/core/Mage/Core/Model/Layout.php
27022708

27032709
-
2704-
message: '#^Cannot unset offset ''@attributes'' on \(array\{\}\|array\{\000\*\000_parent\: Varien_Simplexml_Element\}\)\.$#'
2710+
message: '#^Cannot unset offset ''@attributes'' on \(array\{\}\|array\{''\000\*\000_parent''\: Varien_Simplexml_Element\}\)\.$#'
27052711
identifier: unset.offset
27062712
count: 1
27072713
path: app/code/core/Mage/Core/Model/Layout.php
@@ -3690,12 +3696,6 @@ parameters:
36903696
count: 2
36913697
path: app/code/core/Mage/Index/Model/Resource/Lock/Resource.php
36923698

3693-
-
3694-
message: '#^Offset ''path'' does not exist on array\{\000\*\000_parent\: Varien_Simplexml_Element\}\|array\{false\}\.$#'
3695-
identifier: offsetAccess.notFound
3696-
count: 1
3697-
path: app/code/core/Mage/Install/Model/Config.php
3698-
36993699
-
37003700
message: '#^Method Mage_Install_Model_Installer\:\:getDataModel\(\) should return Mage_Install_Model_Session but returns Mage_Install_Model_Installer_Data\|null\.$#'
37013701
identifier: return.type
@@ -4674,18 +4674,6 @@ parameters:
46744674
count: 3
46754675
path: app/code/core/Mage/Sales/Model/Recurring/Profile.php
46764676

4677-
-
4678-
message: '#^Parameter \#2 \$attribute of method Mage_Sales_Model_Resource_Order_Abstract\:\:_afterSaveAttribute\(\) expects string, array\<mixed, mixed\> given\.$#'
4679-
identifier: argument.type
4680-
count: 1
4681-
path: app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php
4682-
4683-
-
4684-
message: '#^Parameter \#2 \$attribute of method Mage_Sales_Model_Resource_Order_Abstract\:\:_beforeSaveAttribute\(\) expects string, array\<mixed, mixed\> given\.$#'
4685-
identifier: argument.type
4686-
count: 1
4687-
path: app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php
4688-
46894677
-
46904678
message: '#^Cannot call method updateOnRelatedRecordChanged\(\) on Mage_Core_Model_Resource_Db_Collection_Abstract\|false\.$#'
46914679
identifier: method.nonObject

app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function __construct()
2727
parent::__construct();
2828
$this->setTemplate('system/config/edit.phtml');
2929

30+
/** @var string $sectionCode */
3031
$sectionCode = $this->getRequest()->getParam('section');
3132
$sections = Mage::getSingleton('adminhtml/config')->getSections();
3233

app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ public function editAction()
6060
{
6161
$this->_title($this->__('System'))->_title($this->__('Configuration'));
6262

63+
/** @var string $current */
6364
$current = $this->getRequest()->getParam('section');
65+
/** @var string $website */
6466
$website = $this->getRequest()->getParam('website');
67+
/** @var string $store */
6568
$store = $this->getRequest()->getParam('store');
6669

6770
Mage::getSingleton('adminhtml/config_data')
@@ -81,7 +84,10 @@ public function editAction()
8184
$this->loadLayout();
8285

8386
$this->_setActiveMenu('system/config');
84-
$this->getLayout()->getBlock('menu')->setAdditionalCacheKeyInfo([$current]);
87+
88+
/** @var Mage_Adminhtml_Block_Page_Menu $block */
89+
$block = $this->getLayout()->getBlock('menu');
90+
$block->setAdditionalCacheKeyInfo([$current]);
8591

8692
$this->_addBreadcrumb(
8793
Mage::helper('adminhtml')->__('System'),
@@ -241,6 +247,8 @@ public function stateAction()
241247
/**
242248
* Export shipping table rates in csv format
243249
*
250+
* @throws Mage_Core_Exception
251+
* @throws Exception
244252
*/
245253
public function exportTableratesAction()
246254
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function associativeArrayUnpack(&$mixed)
148148
* Corrects data representation.
149149
*
150150
* @param Object $obj - Link to Object
151-
* @return array
151+
* @return string[]
152152
*/
153153
public function clearWsiFootprints(&$obj)
154154
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ public function getProductCollection()
333333
* Retrieve all customer attributes
334334
*
335335
* @param bool $noDesignAttributes
336-
* @return array
336+
* @return Mage_Eav_Model_Entity_Attribute[]
337+
* @throws Mage_Core_Exception
337338
* @todo Use with Flat Resource
338339
*/
339340
public function getAttributes($noDesignAttributes = false)

app/code/core/Mage/Catalog/Model/Category/Api/V2.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function info($categoryId, $store = null, $attributes = null)
5555
* @return int
5656
* @throws Mage_Api_Exception
5757
* @throws Mage_Eav_Model_Entity_Attribute_Exception
58+
* @throws Mage_Core_Exception
5859
*/
5960
public function create($parentId, $categoryData, $store = null)
6061
{
@@ -107,6 +108,7 @@ public function create($parentId, $categoryData, $store = null)
107108
* @param array $categoryData
108109
* @param string|int $store
109110
* @return bool
111+
* @throws Mage_Core_Exception
110112
*/
111113
public function update($categoryId, $categoryData, $store = null)
112114
{

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,14 @@ protected function _prepareDataForSave($product, $productData)
236236
if (property_exists($productData, 'additional_attributes')) {
237237
if (property_exists($productData->additional_attributes, 'single_data')) {
238238
foreach ($productData->additional_attributes->single_data as $_attribute) {
239+
/** @var string $attributeCode */
239240
$attributeCode = $_attribute->key;
240241
$productData->$attributeCode = $_attribute->value;
241242
}
242243
}
243244
if (property_exists($productData->additional_attributes, 'multi_data')) {
244245
foreach ($productData->additional_attributes->multi_data as $_attribute) {
246+
/** @var string $attributeCode */
245247
$attributeCode = $_attribute->key;
246248
$productData->$attributeCode = $_attribute->value;
247249
}
@@ -251,6 +253,7 @@ protected function _prepareDataForSave($product, $productData)
251253

252254
// phpcs:ignore: Ecg.Performance.Loop.DataLoad
253255
foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
256+
/** @var string $attributeCode */
254257
$attributeCode = $attribute->getAttributeCode();
255258

256259
//Unset data if object attribute has no value in current store

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ public function assign($type, $productId, $linkedProductId, $data = [], $identif
4444

4545
$links[(int) $linkedProductId] = [];
4646
foreach ($collection->getLinkModel()->getAttributes() as $attribute) {
47-
if (isset($data->{$attribute['code']})) {
48-
$links[(int) $linkedProductId][$attribute['code']] = $data->{$attribute['code']};
47+
/** @var string $attributeCode */
48+
$attributeCode = $attribute['code'];
49+
if (isset($data->{$attributeCode})) {
50+
$links[(int) $linkedProductId][$attributeCode] = $data->{$attributeCode};
4951
}
5052
}
5153

@@ -102,8 +104,10 @@ public function update($type, $productId, $linkedProductId, $data = [], $identif
102104
}
103105

104106
foreach ($collection->getLinkModel()->getAttributes() as $attribute) {
105-
if (isset($data->{$attribute['code']})) {
106-
$links[(int) $linkedProductId][$attribute['code']] = $data->{$attribute['code']};
107+
/** @var string $attributeCode */
108+
$attributeCode = $attribute['code'];
109+
if (isset($data->{$attributeCode})) {
110+
$links[(int) $linkedProductId][$attributeCode] = $data->{$attributeCode};
107111
}
108112
}
109113

app/code/core/Mage/Core/Controller/Varien/Router/Standard.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ public function getControllerClassName($realModule, $controller)
445445
}
446446

447447
/**
448-
* @return array
448+
* @param string[] $p
449+
* @return string[]
449450
*/
450451
public function rewrite(array $p)
451452
{

app/code/core/Mage/Core/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ public function getGroupedClassName($groupType, $classId, $groupRootNode = null)
13371337
* In MMDB release resource nodes <..._mysql4> were renamed to <..._resource>. So <deprecatedNode> is left
13381338
* to keep name of previously used nodes, that still may be used by non-updated extensions.
13391339
*/
1340-
$deprecatedNode = $config->deprecatedNode;
1340+
$deprecatedNode = (string) $config->deprecatedNode;
13411341
$configOld = $this->_xml->global->{$groupType . 's'}->$deprecatedNode;
13421342
if (isset($configOld->rewrite->$class)) {
13431343
$className = (string) $configOld->rewrite->$class;

0 commit comments

Comments
 (0)