From 3d7eaf63f2211a9e1a8defe8c29e8f6da889ab2e Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 22 Jul 2024 14:01:39 +0200 Subject: [PATCH 1/7] Rector: CQ - UnusedForeachValueToArrayKeysRector (#1) * Rector: CQ - UnusedForeachValueToArrayKeysRector See Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector * fixes + phpstan See fix at rector: https://github.com/rectorphp/rector-src/pull/6164 --- app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php | 4 ++-- app/code/core/Mage/Adminhtml/Block/Page/Menu.php | 2 +- app/code/core/Mage/Adminhtml/Block/Report/Grid.php | 2 +- .../Adminhtml/Block/Sales/Transactions/Child/Grid.php | 2 +- app/code/core/Mage/Adminhtml/Block/Store/Switcher.php | 4 ++-- app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php | 2 +- .../core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php | 2 +- app/code/core/Mage/Adminhtml/Block/Widget/Grid.php | 2 +- .../Block/Widget/Grid/Column/Renderer/Action.php | 2 +- app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php | 2 +- .../Adminhtml/Model/System/Config/Source/Admin/Page.php | 2 +- app/code/core/Mage/Api2/Model/Acl/Filter.php | 2 +- .../Model/Acl/Filter/Attribute/ResourcePermission.php | 2 +- app/code/core/Mage/Catalog/Model/Api2/Product.php | 2 +- app/code/core/Mage/Catalog/Model/Category.php | 2 +- app/code/core/Mage/Catalog/Model/Product/Type/Price.php | 2 +- .../core/Mage/Catalog/Model/Resource/Category/Flat.php | 2 +- app/code/core/Mage/Checkout/Model/Type/Onepage.php | 2 +- .../Mage/ConfigurableSwatches/Helper/Mediafallback.php | 2 +- app/code/core/Mage/Core/Helper/Data.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 2 +- app/code/core/Mage/Core/Model/Layout/Validator.php | 2 +- app/code/core/Mage/Core/Model/Locale.php | 2 +- app/code/core/Mage/Core/Model/Log/Adapter.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite/Request.php | 2 +- app/code/core/Mage/Customer/Model/Address/Api.php | 8 ++++---- app/code/core/Mage/Customer/Model/Address/Api/V2.php | 6 +++--- app/code/core/Mage/Customer/Model/Customer/Api.php | 6 +++--- app/code/core/Mage/Dataflow/Model/Batch.php | 4 ++-- app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php | 2 +- app/code/core/Mage/Eav/Model/Entity/Abstract.php | 2 +- .../Mage/ImportExport/Model/Export/Entity/Product.php | 6 +++--- .../Mage/ImportExport/Model/Import/Entity/Customer.php | 2 +- .../Mage/ImportExport/Model/Import/Entity/Product.php | 2 +- app/code/core/Mage/Index/Model/Event.php | 2 +- app/code/core/Mage/Install/Block/Db/Main.php | 2 +- app/code/core/Mage/Install/Model/Installer/Console.php | 2 +- .../core/Mage/Install/Model/Installer/Db/Abstract.php | 2 +- app/code/core/Mage/Page/Block/Template/Links.php | 2 +- app/code/core/Mage/Paygate/Model/Authorizenet.php | 2 +- app/code/core/Mage/Payment/Block/Form/Cc.php | 2 +- app/code/core/Mage/Payment/Helper/Data.php | 6 +++--- .../core/Mage/Paypal/Model/Resource/Report/Settlement.php | 2 +- app/code/core/Mage/Reports/Model/Totals.php | 2 +- app/code/core/Mage/Rule/Model/Action/Abstract.php | 4 ++-- app/code/core/Mage/Rule/Model/Condition/Abstract.php | 6 +++--- app/code/core/Mage/Rule/Model/Condition/Combine.php | 2 +- .../Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php | 2 +- .../Mage/Sales/Model/Resource/Report/Order/Createdat.php | 2 +- .../core/Mage/Sales/Model/Resource/Sale/Collection.php | 2 +- .../sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php | 2 +- .../sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php | 2 +- app/code/core/Mage/Shipping/Model/Rate/Result.php | 2 +- app/code/core/Mage/Tag/Helper/Data.php | 2 +- app/code/core/Mage/Tag/controllers/IndexController.php | 2 +- .../core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php | 2 +- .../Catalog/Product/Attribute/Edit/AttributeForm.php | 2 +- .../Test/Block/Catalog/Product/Edit/Tab/Prices.php | 4 ++-- .../Adminhtml/Test/Block/Catalog/Product/ProductForm.php | 2 +- .../app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php | 4 ++-- .../tests/app/Mage/Bundle/Test/Handler/Curl.php | 4 ++-- .../DeleteOptionsSubStep.php | 2 +- .../app/Mage/Customer/Test/Handler/Customer/Curl.php | 2 +- .../app/Mage/Weee/Test/Constraint/AssertFptApplied.php | 2 +- lib/Varien/Convert/Parser/Csv.php | 4 ++-- lib/Varien/Db/Statement/Pdo/Mysql.php | 2 +- lib/Varien/Http/Adapter/Curl.php | 2 +- lib/Varien/Object.php | 2 +- lib/Varien/Object/Cache.php | 2 +- phpstan.dist.baseline.neon | 5 ----- 71 files changed, 91 insertions(+), 96 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index 700d3b3b17d..afc5f13938c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -215,7 +215,7 @@ public function getChartUrl($directUrl = true) $dateStart->addMonth(1); break; } - foreach ($this->getAllSeries() as $index => $serie) { + foreach (array_keys($this->getAllSeries()) as $index) { if (in_array($d, $this->_axisLabels['x'])) { $datas[$index][] = (float)array_shift($this->_allSeries[$index]); } else { @@ -328,7 +328,7 @@ public function getChartUrl($directUrl = true) if (count($this->_axisLabels)) { $params['chxt'] = implode(',', array_keys($this->_axisLabels)); $indexid = 0; - foreach ($this->_axisLabels as $idx => $labels) { + foreach (array_keys($this->_axisLabels) as $idx) { if ($idx === 'x') { /** * Format date diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php index d4872f9158d..20bb44f96f4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php @@ -164,7 +164,7 @@ protected function _buildMenuArray(Varien_Simplexml_Element $parent, $path = '', uasort($parentArr, [$this, '_sortMenu']); - foreach ($parentArr as $key => $value) { + foreach (array_keys($parentArr) as $key) { $last = $key; } if (isset($last)) { diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index 180a228a288..efc441c2365 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php @@ -207,7 +207,7 @@ protected function _prepareCollection() */ protected function _setFilterValues($data) { - foreach ($data as $name => $value) { + foreach (array_keys($data) as $name) { $this->setFilter($name, $data[$name]); } return $this; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php index 1e8e12f3dd4..2a585eb5b7d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php @@ -62,7 +62,7 @@ protected function _prepareColumns() { $result = parent::_prepareColumns(); - foreach ($this->_columns as $key => $value) { + foreach (array_keys($this->_columns) as $key) { if (in_array($key, $this->_columnsToRemove)) { unset($this->_columns[$key]); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php index d0c60a17406..33442aa26b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php @@ -73,7 +73,7 @@ public function getWebsites() { $websites = Mage::app()->getWebsites(); if ($websiteIds = $this->getWebsiteIds()) { - foreach ($websites as $websiteId => $website) { + foreach (array_keys($websites) as $websiteId) { if (!in_array($websiteId, $websiteIds)) { unset($websites[$websiteId]); } @@ -140,7 +140,7 @@ public function getStores($group) } $stores = $group->getStores(); if ($storeIds = $this->getStoreIds()) { - foreach ($stores as $storeId => $store) { + foreach (array_keys($stores) as $storeId) { if (!in_array($storeId, $storeIds)) { unset($stores[$storeId]); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php index 9e369a45972..fc959e184ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php @@ -194,7 +194,7 @@ public function getButtonsHtml($area = null) { if ($this->_buttonsHtml === null) { $this->_buttonsHtml = parent::getButtonsHtml(); - foreach ($this->_children as $alias => $child) { + foreach (array_keys($this->_children) as $alias) { if (str_contains($alias, '_button')) { $this->unsetChild($alias); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index a91f22b905a..955c2f871b0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -61,7 +61,7 @@ protected function _prepareForm() 'description' => $model->getDescription(), ]; if ($sessionData = Mage::getSingleton('adminhtml/session')->getData('urlrewrite_data', true)) { - foreach ($formValues as $key => $value) { + foreach (array_keys($formValues) as $key) { if (isset($sessionData[$key])) { $formValues[$key] = $sessionData[$key]; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index af36a237924..5b701ae5133 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -481,7 +481,7 @@ public function getColumns() */ protected function _setFilterValues($data) { - foreach ($data as $columnId => $value) { + foreach (array_keys($data) as $columnId) { $column = $this->getColumn($columnId); if ($column instanceof Mage_Adminhtml_Block_Widget_Grid_Column && (!empty($data[$columnId]) || strlen($data[$columnId]) > 0) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php index 1fe5f9905b6..9bdad27dbbf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php @@ -109,7 +109,7 @@ protected function _toLinkHtml($action, Varien_Object $row) */ protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row) { - foreach ($action as $attribute => $value) { + foreach (array_keys($action) as $attribute) { if (isset($action[$attribute]) && !is_array($action[$attribute])) { $this->getColumn()->setFormat($action[$attribute]); $action[$attribute] = parent::render($row); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php index 94e9fae48a6..ca58c8f7fc6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php @@ -256,7 +256,7 @@ protected function _reorderTabs() asort($this->_tabPositions); $ordered = []; - foreach ($this->_tabPositions as $tabId => $position) { + foreach (array_keys($this->_tabPositions) as $tabId) { if (isset($this->_tabs[$tabId])) { $tab = $this->_tabs[$tabId]; $ordered[$tabId] = $tab; diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index e79b3daedc4..92bfd9d0639 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -109,7 +109,7 @@ protected function _buildMenuArray(?Varien_Simplexml_Element $parent = null, $pa uasort($parentArr, [$this, '_sortMenu']); - foreach ($parentArr as $key => $value) { + foreach (array_keys($parentArr) as $key) { $last = $key; } if (isset($last)) { diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter.php b/app/code/core/Mage/Api2/Model/Acl/Filter.php index 3494dfceb14..cefef4dd4f6 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Filter.php +++ b/app/code/core/Mage/Api2/Model/Acl/Filter.php @@ -61,7 +61,7 @@ public function __construct(Mage_Api2_Model_Resource $resource) */ protected function _filter(array $allowedAttributes, array $data) { - foreach ($data as $attribute => $value) { + foreach (array_keys($data) as $attribute) { if (!in_array($attribute, $allowedAttributes)) { unset($data[$attribute]); } diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php index 1016b87c227..f58a244ca00 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php +++ b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php @@ -103,7 +103,7 @@ public function getResourcesPermissions() $resourceModel->setResourceType($resource) ->setUserType($this->_userType); - foreach ($operations as $operation => $operationLabel) { + foreach (array_keys($operations) as $operation) { if (!$this->_hasEntityOnlyAttributes && $config->getResourceEntityOnlyAttributes($resource, $this->_userType, $operation) ) { diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product.php b/app/code/core/Mage/Catalog/Model/Api2/Product.php index 586f1db4acd..f757413be4b 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product.php @@ -42,7 +42,7 @@ public function getAvailableAttributes($userType, $operation) } $excludedAttrs = $this->getExcludedAttributes($userType, $operation); $includedAttrs = $this->getIncludedAttributes($userType, $operation); - foreach ($attributes as $code => $label) { + foreach (array_keys($attributes) as $code) { if (in_array($code, $excludedAttrs) || ($includedAttrs && !in_array($code, $includedAttrs))) { unset($attributes[$code]); } diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 58cd0b2c7c9..5ff10b609dc 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -346,7 +346,7 @@ public function getAttributes($noDesignAttributes = false) ->getSortedAttributes(); if ($noDesignAttributes) { - foreach ($result as $k => $a) { + foreach (array_keys($result) as $k) { if (in_array($k, $this->_designAttributes)) { unset($result[$k]); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php index 62e6d7f86ae..df7d7f731c9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php @@ -300,7 +300,7 @@ public function getFormatedTierPrice($qty, $product) { $price = $product->getTierPrice($qty); if (is_array($price)) { - foreach ($price as $index => $value) { + foreach (array_keys($price) as $index) { $price[$index]['formated_price'] = Mage::app()->getStore()->convertPrice( $price[$index]['website_price'], true diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 3a03e409ef5..7e962fb0b72 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -1152,7 +1152,7 @@ protected function _prepareDataForAllFields($category, $replaceFields = []) $table = $this->_getReadAdapter()->describeTable($table); $data = []; $idFieldName = Mage::getSingleton('catalog/category')->getIdFieldName(); - foreach ($table as $column => $columnData) { + foreach (array_keys($table) as $column) { if ($column != $idFieldName || $category->getData($column) !== null) { if (array_key_exists($column, $replaceFields)) { $value = $category->getData($replaceFields[$column]); diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index f1d8d4a5ced..2cdbe2eec65 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -119,7 +119,7 @@ public function initCheckout() $checkout = $this->getCheckout(); $customerSession = $this->getCustomerSession(); if (is_array($checkout->getStepData())) { - foreach ($checkout->getStepData() as $step => $data) { + foreach (array_keys($checkout->getStepData()) as $step) { if (!($step === 'login' || $customerSession->isLoggedIn() && $step === 'billing')) { $checkout->setStepData($step, 'allow', false); } diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php index db49ed16933..da23ea014ad 100644 --- a/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php +++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php @@ -136,7 +136,7 @@ public function attachProductChildrenAttributeMapping(array $parentProducts, $st } // end looping child products } // end looping attributes - foreach ($mapping as $key => $value) { + foreach (array_keys($mapping) as $key) { $mapping[$key]['product_ids'] = array_unique($mapping[$key]['product_ids']); } diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index 73029d7952c..d3c9a73ac45 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -603,7 +603,7 @@ public function assocToXml(array $array, $rootName = '_') <$rootName> XML; $xml = new SimpleXMLElement($xmlstr); - foreach ($array as $key => $value) { + foreach (array_keys($array) as $key) { if (is_numeric($key)) { throw new Exception('Array root keys must not be numeric.'); } diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index fe97c2c491f..9965019bf1e 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -625,7 +625,7 @@ public function getInvalidatedTypes() $types = $this->_getInvalidatedTypes(); if ($types) { $allTypes = $this->getTypes(); - foreach ($types as $type => $flag) { + foreach (array_keys($types) as $type) { if (isset($allTypes[$type]) && $this->canUse($type)) { $invalidatedTypes[$type] = $allTypes[$type]; } diff --git a/app/code/core/Mage/Core/Model/Layout/Validator.php b/app/code/core/Mage/Core/Model/Layout/Validator.php index 9bedeaf8621..2d14731992b 100644 --- a/app/code/core/Mage/Core/Model/Layout/Validator.php +++ b/app/code/core/Mage/Core/Model/Layout/Validator.php @@ -108,7 +108,7 @@ public function getDisallowedBlocks() if (!count($this->_disallowedBlock)) { $disallowedBlockConfig = $this->_getDisallowedBlockConfigValue(); if (is_array($disallowedBlockConfig)) { - foreach ($disallowedBlockConfig as $blockName => $value) { + foreach (array_keys($disallowedBlockConfig) as $blockName) { $this->_disallowedBlock[] = $blockName; } } diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index d3b70a7c1cd..2a0c44563c3 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -247,7 +247,7 @@ protected function _getOptionLocales($translatedName = false) } } - foreach ($locales as $code => $active) { + foreach (array_keys($locales) as $code) { if (strstr($code, '_')) { if (!in_array($code, $allowed)) { continue; diff --git a/app/code/core/Mage/Core/Model/Log/Adapter.php b/app/code/core/Mage/Core/Model/Log/Adapter.php index 3bc190114c0..1a173c94d99 100644 --- a/app/code/core/Mage/Core/Model/Log/Adapter.php +++ b/app/code/core/Mage/Core/Model/Log/Adapter.php @@ -115,7 +115,7 @@ public function setFilterDataKeys($keys) protected function _filterDebugData($debugData) { if (is_array($debugData) && is_array($this->_debugReplacePrivateDataKeys)) { - foreach ($debugData as $key => $value) { + foreach (array_keys($debugData) as $key) { if (in_array($key, $this->_debugReplacePrivateDataKeys)) { $debugData[$key] = '****'; } else { diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index a9bae5f2912..929f39be12c 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -319,7 +319,7 @@ protected function _getQueryString() $queryParams = []; parse_str($_SERVER['QUERY_STRING'], $queryParams); $hasChanges = false; - foreach ($queryParams as $key => $value) { + foreach (array_keys($queryParams) as $key) { if (substr($key, 0, 3) === '___') { unset($queryParams[$key]); $hasChanges = true; diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php index 80bf9ce24de..f6c14bf4b9a 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php @@ -306,7 +306,7 @@ protected function _getQueryString() $queryParams = []; parse_str($_SERVER['QUERY_STRING'], $queryParams); $hasChanges = false; - foreach ($queryParams as $key => $value) { + foreach (array_keys($queryParams) as $key) { if (substr($key, 0, 3) === '___') { unset($queryParams[$key]); $hasChanges = true; diff --git a/app/code/core/Mage/Customer/Model/Address/Api.php b/app/code/core/Mage/Customer/Model/Address/Api.php index 63120a58f38..9f779558882 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api.php +++ b/app/code/core/Mage/Customer/Model/Address/Api.php @@ -55,7 +55,7 @@ public function items($customerId) $row[$attributeAlias] = $data[$attributeCode] ?? null; } - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { if (isset($data[$attributeCode])) { $row[$attributeCode] = $data[$attributeCode]; } @@ -89,7 +89,7 @@ public function create($customerId, $addressData) $address = Mage::getModel('customer/address'); - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { if (isset($addressData[$attributeCode])) { $address->setData($attributeCode, $addressData[$attributeCode]); } @@ -141,7 +141,7 @@ public function info($addressId) $result[$attributeAlias] = $address->getData($attributeCode); } - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { $result[$attributeCode] = $address->getData($attributeCode); } @@ -169,7 +169,7 @@ public function update($addressId, $addressData) $this->_fault('not_exists'); } - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { if (isset($addressData[$attributeCode])) { $address->setData($attributeCode, $addressData[$attributeCode]); } diff --git a/app/code/core/Mage/Customer/Model/Address/Api/V2.php b/app/code/core/Mage/Customer/Model/Address/Api/V2.php index 8616fec57a1..901b932eef7 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Address/Api/V2.php @@ -40,7 +40,7 @@ public function create($customerId, $addressData) $address = Mage::getModel('customer/address'); - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { if (isset($addressData->$attributeCode)) { $address->setData($attributeCode, $addressData->$attributeCode); } @@ -92,7 +92,7 @@ public function info($addressId) $result[$attributeAlias] = $address->getData($attributeCode); } - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { $result[$attributeCode] = $address->getData($attributeCode); } @@ -120,7 +120,7 @@ public function update($addressId, $addressData) $this->_fault('not_exists'); } - foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { if (isset($addressData->$attributeCode)) { $address->setData($attributeCode, $addressData->$attributeCode); } diff --git a/app/code/core/Mage/Customer/Model/Customer/Api.php b/app/code/core/Mage/Customer/Model/Customer/Api.php index 16853c6c60e..f8daaa27a89 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api.php @@ -87,7 +87,7 @@ public function info($customerId, $attributes = null) $result[$attributeAlias] = $customer->getData($attributeCode); } - foreach ($this->getAllowedAttributes($customer, $attributes) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($customer, $attributes)) as $attributeCode) { $result[$attributeCode] = $customer->getData($attributeCode); } @@ -121,7 +121,7 @@ public function items($filters) foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) { $row[$attributeAlias] = $data[$attributeCode] ?? null; } - foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($customer)) as $attributeCode) { if (isset($data[$attributeCode])) { $row[$attributeCode] = $data[$attributeCode]; } @@ -149,7 +149,7 @@ public function update($customerId, $customerData) $this->_fault('not_exists'); } - foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) { + foreach (array_keys($this->getAllowedAttributes($customer)) as $attributeCode) { if (isset($customerData[$attributeCode])) { $customer->setData($attributeCode, $customerData[$attributeCode]); } diff --git a/app/code/core/Mage/Dataflow/Model/Batch.php b/app/code/core/Mage/Dataflow/Model/Batch.php index 1f727062e73..1235b8f468f 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Batch.php @@ -92,12 +92,12 @@ public function getFieldList() */ public function parseFieldList($row) { - foreach ($row as $fieldName => $value) { + foreach (array_keys($row) as $fieldName) { if (!in_array($fieldName, $this->_fieldList)) { $this->_fieldList[$fieldName] = $fieldName; } } - unset($fieldName, $value, $row); + unset($fieldName, $row); } /** diff --git a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php index 1a15c400f15..fdf30b8c5f6 100644 --- a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php @@ -47,7 +47,7 @@ public function parse() $fields = $line; continue; } else { - foreach ($line as $j => $f) { + foreach (array_keys($line) as $j) { $fields[$j] = 'column' . ($j + 1); } } diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 25c93a56c2e..01c39e4c918 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -1594,7 +1594,7 @@ public function delete($object) ]; $this->_getWriteAdapter()->delete($this->getEntityTable(), $where); $this->loadAllAttributes($object); - foreach ($this->getAttributesByTable() as $table => $attributes) { + foreach (array_keys($this->getAttributesByTable()) as $table) { $this->_getWriteAdapter()->delete($table, $where); } } catch (Exception $e) { diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php index 91b578e810a..1ecb2e87b92 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php @@ -790,7 +790,7 @@ protected function _prepareExport() '_custom_option_row_sku', '_custom_option_row_sort' ]; - foreach ($this->_storeIdToCode as $storeId => &$storeCode) { + foreach (array_keys($this->_storeIdToCode) as &$storeId) { $skip = false; $options = Mage::getResourceModel('catalog/product_option_collection') ->reset() @@ -961,7 +961,7 @@ protected function _prepareExport() $dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); } if (!empty($rowMultiselects[$productId][$storeId])) { - foreach ($rowMultiselects[$productId][$storeId] as $attrKey => $attrVal) { + foreach (array_keys($rowMultiselects[$productId][$storeId]) as $attrKey) { if (isset($rowMultiselects[$productId][$storeId][$attrKey])) { $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$storeId][$attrKey]); } @@ -1039,7 +1039,7 @@ protected function _prepareExport() $dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); } if (!empty($rowMultiselects[$productId][$storeId])) { - foreach ($rowMultiselects[$productId][$storeId] as $attrKey => $attrVal) { + foreach (array_keys($rowMultiselects[$productId][$storeId]) as $attrKey) { if (isset($rowMultiselects[$productId][$storeId][$attrKey])) { $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$storeId][$attrKey]); } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php index 6c1771b734e..5fc9083546d 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php @@ -547,7 +547,7 @@ public function getEntityTypeCode() public function getRowScope(array $rowData) { $foundOptions = false; - foreach ($this->_multiSelectAttributes as $attrCode => $attribute) { + foreach (array_keys($this->_multiSelectAttributes) as $attrCode) { if ($rowData[$attrCode]) { $foundOptions = true; } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index 0a4cf80d21e..914c5be124f 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -1099,7 +1099,7 @@ protected function _saveCustomOptions() if ($productIds) { // update product entity table to show that product has options $customOptionsProducts = $customOptions['product_id']; - foreach ($customOptionsProducts as $key => $value) { + foreach (array_keys($customOptionsProducts) as $key) { if (!in_array($key, $productIds)) { unset($customOptionsProducts[$key]); } diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index 2035a5be359..d4dc4468a17 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -157,7 +157,7 @@ protected function _mergeNewDataRecursive($previous, $current) return $previous; } - foreach ($previous as $key => $value) { + foreach (array_keys($previous) as $key) { if (array_key_exists($key, $current) && !is_null($current[$key]) && is_array($previous[$key])) { if (!is_string($key) || is_array($current[$key])) { $current[$key] = $this->_mergeNewDataRecursive($previous[$key], $current[$key]); diff --git a/app/code/core/Mage/Install/Block/Db/Main.php b/app/code/core/Mage/Install/Block/Db/Main.php index 9f0789c1ea3..25791d2f5f8 100644 --- a/app/code/core/Mage/Install/Block/Db/Main.php +++ b/app/code/core/Mage/Install/Block/Db/Main.php @@ -77,7 +77,7 @@ public function getDatabaseBlock($type) public function getDatabaseBlocks() { $databases = []; - foreach ($this->_databases as $type => $blockData) { + foreach (array_keys($this->_databases) as $type) { $databases[] = $this->getDatabaseBlock($type); } return $databases; diff --git a/app/code/core/Mage/Install/Model/Installer/Console.php b/app/code/core/Mage/Install/Model/Installer/Console.php index 033d8db36a4..7c31a5007ab 100644 --- a/app/code/core/Mage/Install/Model/Installer/Console.php +++ b/app/code/core/Mage/Install/Model/Installer/Console.php @@ -155,7 +155,7 @@ public function setArgs($args = null) /** * Set args values */ - foreach ($this->_getOptions() as $name => $option) { + foreach (array_keys($this->_getOptions()) as $name) { $this->_args[$name] = $args[$name] ?? ''; } diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php index 40155d07e4a..33b6de0c2ea 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php @@ -136,7 +136,7 @@ public function getRequiredExtensions() { $extensions = []; $configExt = (array)Mage::getConfig()->getNode(sprintf('install/databases/%s/extensions', $this->getModel())); - foreach ($configExt as $name => $value) { + foreach (array_keys($configExt) as $name) { $extensions[] = $name; } return $extensions; diff --git a/app/code/core/Mage/Page/Block/Template/Links.php b/app/code/core/Mage/Page/Block/Template/Links.php index b52e2f367eb..aacfd69b27e 100644 --- a/app/code/core/Mage/Page/Block/Template/Links.php +++ b/app/code/core/Mage/Page/Block/Template/Links.php @@ -242,7 +242,7 @@ protected function _getNewPosition($position = 0) } } else { $position = 0; - foreach ($this->_links as $k => $v) { + foreach (array_keys($this->_links) as $k) { $position = $k; } $position += 10; diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 5659e2caac3..c32a8b69385 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -1475,7 +1475,7 @@ protected function _addTransaction( $payment->setTransactionAdditionalInfo($key, $value); } $transaction = $payment->addTransaction($transactionType, null, false, $message); - foreach ($transactionDetails as $key => $value) { + foreach (array_keys($transactionDetails) as $key) { $payment->unsetData($key); } $payment->unsLastTransId(); diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 5435e7f4a75..08a12b4c037 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -47,7 +47,7 @@ public function getCcAvailableTypes() $availableTypes = $method->getConfigData('cctypes'); if ($availableTypes) { $availableTypes = explode(',', $availableTypes); - foreach ($types as $code => $name) { + foreach (array_keys($types) as $code) { if (!in_array($code, $availableTypes)) { unset($types[$code]); } diff --git a/app/code/core/Mage/Payment/Helper/Data.php b/app/code/core/Mage/Payment/Helper/Data.php index a7f9071c590..fed881ddeae 100644 --- a/app/code/core/Mage/Payment/Helper/Data.php +++ b/app/code/core/Mage/Payment/Helper/Data.php @@ -67,7 +67,7 @@ public function getMethodInstance($code) public function getStoreMethods($store = null, $quote = null) { $res = []; - foreach ($this->getPaymentMethods($store) as $code => $methodConfig) { + foreach (array_keys($this->getPaymentMethods($store)) as $code) { $prefix = self::XML_PATH_PAYMENT_METHODS . '/' . $code . '/'; if (!$model = Mage::getStoreConfig($prefix . 'model', $store)) { continue; @@ -166,7 +166,7 @@ public function getBillingAgreementMethods($store = null, $quote = null) public function getRecurringProfileMethods($store = null) { $result = []; - foreach ($this->getPaymentMethods($store) as $code => $data) { + foreach (array_keys($this->getPaymentMethods($store)) as $code) { $paymentMethodModelClassName = $this->getMethodModelClassName($code); if (!$paymentMethodModelClassName) { continue; @@ -244,7 +244,7 @@ public function getPaymentMethodList($sorted = true, $asLabelValue = false, $wit } if ($asLabelValue) { $labelValues = []; - foreach ($methods as $code => $title) { + foreach (array_keys($methods) as $code) { $labelValues[$code] = []; } foreach ($methods as $code => $title) { diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php index ec75245e7e2..fca1a3d661e 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php @@ -58,7 +58,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) /** @var Mage_Core_Model_Date $date */ $date = Mage::getSingleton('core/date'); - foreach ($rows as $key => $row) { + foreach (array_keys($rows) as $key) { /* * Converting dates */ diff --git a/app/code/core/Mage/Reports/Model/Totals.php b/app/code/core/Mage/Reports/Model/Totals.php index 33f899cc705..6b98422fdee 100644 --- a/app/code/core/Mage/Reports/Model/Totals.php +++ b/app/code/core/Mage/Reports/Model/Totals.php @@ -47,7 +47,7 @@ public function countTotals($grid, $from, $to) } $data = $item->getData(); - foreach ($columns as $field => $a) { + foreach (array_keys($columns) as $field) { if ($field !== '') { $columns[$field]['value'] += $data[$field] ?? 0; } diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index a810922d2f7..d8cb87fb7f4 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -52,11 +52,11 @@ public function __construct() parent::__construct(); $this->loadAttributeOptions()->loadOperatorOptions()->loadValueOptions(); - foreach ($this->getAttributeOption() as $attr => $dummy) { + foreach (array_keys($this->getAttributeOption()) as $attr) { $this->setAttribute($attr); break; } - foreach ($this->getOperatorOption() as $operator => $dummy) { + foreach (array_keys($this->getOperatorOption()) as $operator) { $this->setOperator($operator); break; } diff --git a/app/code/core/Mage/Rule/Model/Condition/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Abstract.php index d2e67c86270..e31fbdda29c 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Abstract.php @@ -92,13 +92,13 @@ public function __construct() $this->loadAttributeOptions()->loadOperatorOptions()->loadValueOptions(); if ($options = $this->getAttributeOptions()) { - foreach ($options as $attr => $dummy) { + foreach (array_keys($options) as $attr) { $this->setAttribute($attr); break; } } if ($options = $this->getOperatorOptions()) { - foreach ($options as $operator => $dummy) { + foreach (array_keys($options) as $operator) { $this->setOperator($operator); break; } @@ -503,7 +503,7 @@ public function getTypeElementHtml() public function getAttributeElement() { if (is_null($this->getAttribute())) { - foreach ($this->getAttributeOption() as $k => $v) { + foreach (array_keys($this->getAttributeOption()) as $k) { $this->setAttribute($k); break; } diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index 79d4e693c38..1d9b0093d13 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -95,7 +95,7 @@ public function __construct() $this->loadAggregatorOptions(); if ($options = $this->getAggregatorOptions()) { - foreach ($options as $aggregator => $dummy) { + foreach (array_keys($options) as $aggregator) { $this->setAggregator($aggregator); break; } diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index 52bf6a9b347..713bee21bab 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -125,7 +125,7 @@ protected function _prepareColumns() { $result = parent::_prepareColumns(); - foreach ($this->_columns as $key => $value) { + foreach (array_keys($this->_columns) as $key) { if (in_array($key, $this->_columnsToRemove)) { unset($this->_columns[$key]); } diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php index 323ce47e00f..a9971351972 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php @@ -230,7 +230,7 @@ protected function _aggregateByField($aggregationField, $from, $to) $adapter->query($select->insertFromSelect($this->getMainTable(), array_keys($columns))); // setup all columns to select SUM() except period, store_id and order_status - foreach ($columns as $k => $v) { + foreach (array_keys($columns) as $k) { $columns[$k] = new Zend_Db_Expr('SUM(' . $k . ')'); } $columns['period'] = 'period'; diff --git a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php index 1bf6ed99bf1..f2972e84cc9 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php @@ -182,7 +182,7 @@ public function load($printQuery = false, $logQuery = false) ->setWebsiteId(Mage::app()->getStore($storeId)->getWebsiteId()) ->setAvgNormalized($v['avgsale'] * $v['num_orders']); $this->_items[$storeId] = $storeObject; - foreach ($this->_totals as $key => $value) { + foreach (array_keys($this->_totals) as $key) { $this->_totals[$key] += $storeObject->getData($key); } } diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php index 43d089aa854..9525a968c57 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -183,7 +183,7 @@ $select->from(['e' => $this->getTable('sales_order_entity')]); $attributeIds = []; -foreach ($attributes as $code => $params) { +foreach (array_keys($attributes) as $code) { $attributes[$code] = $installer->getAttribute($orderEntityTypeId, $code); if ($attributes[$code]['backend_type'] != 'static') { $select->joinLeft( diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php index 3e9e34ea693..69722481f54 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php @@ -46,7 +46,7 @@ "); /* get order_payment attribute codes*/ -foreach ($attributesIds as $attributeCode => $attributeId) { +foreach (array_keys($attributesIds) as $attributeCode) { $attributesIds[$attributeCode] = $connection->fetchOne(" SELECT attribute_id FROM {$this->getTable('eav_attribute')} diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result.php b/app/code/core/Mage/Shipping/Model/Rate/Result.php index fa06daacb29..bc7ad148a12 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result.php @@ -180,7 +180,7 @@ public function sortRatesByPrice() natsort($tmp); - foreach ($tmp as $i => $price) { + foreach (array_keys($tmp) as $i) { $result[] = $this->_rates[$i]; } diff --git a/app/code/core/Mage/Tag/Helper/Data.php b/app/code/core/Mage/Tag/Helper/Data.php index c86d4d5eee1..a2de68080cc 100644 --- a/app/code/core/Mage/Tag/Helper/Data.php +++ b/app/code/core/Mage/Tag/Helper/Data.php @@ -73,7 +73,7 @@ public function extractTags($tagNamesInString) */ public function cleanTags(array $tagNamesArr) { - foreach ($tagNamesArr as $key => $tagName) { + foreach (array_keys($tagNamesArr) as $key) { $tagNamesArr[$key] = trim($tagNamesArr[$key], '\''); $tagNamesArr[$key] = trim($tagNamesArr[$key]); if ($tagNamesArr[$key] == '') { diff --git a/app/code/core/Mage/Tag/controllers/IndexController.php b/app/code/core/Mage/Tag/controllers/IndexController.php index 54b26c441f7..833837c75b6 100644 --- a/app/code/core/Mage/Tag/controllers/IndexController.php +++ b/app/code/core/Mage/Tag/controllers/IndexController.php @@ -99,7 +99,7 @@ protected function _extractTags($tagNamesInString) */ protected function _cleanTags(array $tagNamesArr) { - foreach ($tagNamesArr as $key => $tagName) { + foreach (array_keys($tagNamesArr) as $key) { $tagNamesArr[$key] = trim($tagNamesArr[$key], '\''); $tagNamesArr[$key] = trim($tagNamesArr[$key]); if ($tagNamesArr[$key] == '') { diff --git a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php index ed49099010c..f6ed065e028 100644 --- a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -74,7 +74,7 @@ public function afterLoad($object) { $data = $this->_getResource()->loadProductData($object, $this->getAttribute()); - foreach ($data as $i => $row) { + foreach (array_keys($data) as $i) { if ($data[$i]['website_id'] == 0) { $rate = Mage::app()->getStore()->getBaseCurrency()->getRate(Mage::app()->getBaseCurrencyCode()); if ($rate) { diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php index 9683e4322cd..1344cfc1a92 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php @@ -45,7 +45,7 @@ public function getData(FixtureInterface $fixture = null, Element $element = nul { $data = []; if ($fixture === null) { - foreach ($this->tabs as $tabName => $tab) { + foreach (array_keys($this->tabs) as $tabName) { $this->openTab($tabName); $tabData = $this->getTabElement($tabName)->getDataFormTab(); $data = array_merge($data, $tabData); diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php index 3346dcc17a8..657f84a8239 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php @@ -54,7 +54,7 @@ class Prices extends Tab public function fillFormTab(array $fields, Element $element = null) { $context = $element ? $element : $this->_rootElement; - foreach ($this->childrenForm as $key => $value) { + foreach (array_keys($this->childrenForm) as $key) { if (isset($fields[$key])) { $this->fillOptionsPrices([$key => $fields[$key]], $context); unset($fields[$key]); @@ -91,7 +91,7 @@ public function getDataFormTab($fields = null, Element $element = null) { $result = []; $context = $element ? $element : $this->_rootElement; - foreach ($this->childrenForm as $key => $value) { + foreach (array_keys($this->childrenForm) as $key) { if (isset($fields[$key])) { $result[$key] = $this->getOptionsPrices([$key => $fields[$key]], $context); unset($fields[$key]); diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php index 584a8f25fbc..565b823b7c5 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php @@ -341,7 +341,7 @@ public function getRequireNoticeAttributes(FixtureInterface $product) { $data = []; $tabs = $this->getFieldsByTabs($product); - foreach ($tabs as $tabName => $fields) { + foreach (array_keys($tabs) as $tabName) { $tab = $this->getTabElement($tabName); $this->openTab($tabName); $errors = $tab->getRequireNoticeMessages(); diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php index 8d9596cda76..a0c24f0c42d 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php @@ -135,7 +135,7 @@ protected function fillTabs(array $tabs, Element $element = null) */ protected function fillMissedFields() { - foreach ($this->tabs as $tabName => $tabData) { + foreach (array_keys($this->tabs) as $tabName) { $tabElement = $this->getTabElement($tabName); if ($this->openTab($tabName)) { $mapping = $tabElement->dataMapping($this->unassignedFields); @@ -174,7 +174,7 @@ public function getData(FixtureInterface $fixture = null, Element $element = nul $data = []; if (null === $fixture) { - foreach ($this->tabs as $tabName => $tab) { + foreach (array_keys($this->tabs) as $tabName) { $this->openTab($tabName); $tabData = $this->getTabElement($tabName)->getDataFormTab(); $data = array_merge($data, $tabData); diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php index e4777d9f973..eb79bfc90ef 100644 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php +++ b/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php @@ -146,7 +146,7 @@ protected function prepareBundleSelections(array $bundleData) */ protected function prepareItemSelectionData(array $selections, array $products) { - foreach ($selections as $key => $selection) { + foreach (array_keys($selections) as $key) { $selections[$key]['product_id'] = $products[$key]->getId(); unset($selections[$key]['sku']); $selections[$key]['delete'] = ''; @@ -163,7 +163,7 @@ protected function prepareItemSelectionData(array $selections, array $products) */ protected function prepareBundleOptions(array $bundleData) { - foreach ($bundleData as $key => $option) { + foreach (array_keys($bundleData) as $key) { $bundleData[$key] = array_intersect_key($bundleData[$key], array_flip($this->optionsFields)); $bundleData[$key]['delete'] = ''; } diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php index 6b18d2b8ea3..16d05ab359c 100644 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php +++ b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php @@ -86,7 +86,7 @@ protected function searchKeysForOption($optionIndex) { $keys = []; $originalProductAssignedProducts = $this->getOriginalProductAssignedProducts(); - foreach ($originalProductAssignedProducts as $key => $product) { + foreach (array_keys($originalProductAssignedProducts) as $key) { if (strpos($key, 'option_key_' . $optionIndex) !== false) { $keys[] = $key; } diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php index 68f2f85b69a..23d27ff801b 100644 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php +++ b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php @@ -131,7 +131,7 @@ public function persist(FixtureInterface $customer = null) */ protected function checkForUpdateData(array $data) { - foreach ($data as $key => $field) { + foreach (array_keys($data) as $key) { if (in_array($key, $this->updatingFields)) { return true; } diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php index c1b61df6d23..baf99e0e016 100644 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php +++ b/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php @@ -145,7 +145,7 @@ protected function clearShoppingCart() protected function getPrices() { $actualPrices = []; - foreach ($this->expectedPrices as $priceType => $prices) { + foreach (array_keys($this->expectedPrices) as $priceType) { $actualPrices[$priceType] = $this->{'get' . ucfirst($priceType) . 'Price'}(); } diff --git a/lib/Varien/Convert/Parser/Csv.php b/lib/Varien/Convert/Parser/Csv.php index f857c3b85a8..4550d155691 100644 --- a/lib/Varien/Convert/Parser/Csv.php +++ b/lib/Varien/Convert/Parser/Csv.php @@ -44,7 +44,7 @@ public function parse() $fields = $line; continue; } else { - foreach ($line as $j => $f) { + foreach (array_keys($line) as $j) { $fields[$j] = 'column' . ($j + 1); } } @@ -87,7 +87,7 @@ public function parseTest() $fields = $line; continue; } else { - foreach ($line as $j => $f) { + foreach (array_keys($line) as $j) { $fields[$j] = 'column' . ($j + 1); } } diff --git a/lib/Varien/Db/Statement/Pdo/Mysql.php b/lib/Varien/Db/Statement/Pdo/Mysql.php index b23cb8435fa..d5f83882237 100644 --- a/lib/Varien/Db/Statement/Pdo/Mysql.php +++ b/lib/Varien/Db/Statement/Pdo/Mysql.php @@ -33,7 +33,7 @@ public function _executeWithBinding(array $params) { // Check whether we deal with named bind $isPositionalBind = true; - foreach ($params as $k => $v) { + foreach (array_keys($params) as $k) { if (!is_int($k)) { $isPositionalBind = false; break; diff --git a/lib/Varien/Http/Adapter/Curl.php b/lib/Varien/Http/Adapter/Curl.php index 56e9359a23f..1e9fd81f16b 100644 --- a/lib/Varien/Http/Adapter/Curl.php +++ b/lib/Varien/Http/Adapter/Curl.php @@ -75,7 +75,7 @@ protected function _applyConfig() $verifyHost = isset($this->_config['verifyhost']) ? $this->_config['verifyhost'] : 0; curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYHOST, $verifyHost); - foreach ($this->_config as $param => $curlOption) { + foreach (array_keys($this->_config) as $param) { if (array_key_exists($param, $this->_allowedParams)) { curl_setopt($this->_getResource(), $this->_allowedParams[$param], $this->_config[$param]); } diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index bfd0f11bcff..968d5b0fc02 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -292,7 +292,7 @@ public function unsetData($key = null) public function unsetOldData($key = null) { if (is_null($key)) { - foreach ($this->_oldFieldsMap as $key => $newFieldName) { + foreach (array_keys($this->_oldFieldsMap) as $key) { unset($this->_data[$key]); } } else { diff --git a/lib/Varien/Object/Cache.php b/lib/Varien/Object/Cache.php index 11b6cc23775..24047b87356 100644 --- a/lib/Varien/Object/Cache.php +++ b/lib/Varien/Object/Cache.php @@ -241,7 +241,7 @@ public function delete($idx) } if (isset($this->_objectReferences[$idx])) { - foreach ($this->_references as $r => $dummy) { + foreach (array_keys($this->_references) as $r) { unset($this->_references[$r]); } unset($this->_objectReferences[$idx]); diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index 8fd0d3944fa..21489364a42 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -3400,11 +3400,6 @@ parameters: count: 1 path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - - message: "#^Offset int\\|string on non\\-empty\\-array\\ in isset\\(\\) always exists and is not nullable\\.$#" - count: 2 - path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - message: "#^Variable \\$collection might not be defined\\.$#" count: 1 From 591a218019f35a3eb32829e8a73bf28eb75fd820 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 28 Jul 2024 02:32:23 +0200 Subject: [PATCH 2/7] Revert "Rector: CQ - UnusedForeachValueToArrayKeysRector (#1)" This reverts commit 3d7eaf63f2211a9e1a8defe8c29e8f6da889ab2e. --- app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php | 4 ++-- app/code/core/Mage/Adminhtml/Block/Page/Menu.php | 2 +- app/code/core/Mage/Adminhtml/Block/Report/Grid.php | 2 +- .../Adminhtml/Block/Sales/Transactions/Child/Grid.php | 2 +- app/code/core/Mage/Adminhtml/Block/Store/Switcher.php | 4 ++-- app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php | 2 +- .../core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php | 2 +- app/code/core/Mage/Adminhtml/Block/Widget/Grid.php | 2 +- .../Block/Widget/Grid/Column/Renderer/Action.php | 2 +- app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php | 2 +- .../Adminhtml/Model/System/Config/Source/Admin/Page.php | 2 +- app/code/core/Mage/Api2/Model/Acl/Filter.php | 2 +- .../Model/Acl/Filter/Attribute/ResourcePermission.php | 2 +- app/code/core/Mage/Catalog/Model/Api2/Product.php | 2 +- app/code/core/Mage/Catalog/Model/Category.php | 2 +- app/code/core/Mage/Catalog/Model/Product/Type/Price.php | 2 +- .../core/Mage/Catalog/Model/Resource/Category/Flat.php | 2 +- app/code/core/Mage/Checkout/Model/Type/Onepage.php | 2 +- .../Mage/ConfigurableSwatches/Helper/Mediafallback.php | 2 +- app/code/core/Mage/Core/Helper/Data.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 2 +- app/code/core/Mage/Core/Model/Layout/Validator.php | 2 +- app/code/core/Mage/Core/Model/Locale.php | 2 +- app/code/core/Mage/Core/Model/Log/Adapter.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite/Request.php | 2 +- app/code/core/Mage/Customer/Model/Address/Api.php | 8 ++++---- app/code/core/Mage/Customer/Model/Address/Api/V2.php | 6 +++--- app/code/core/Mage/Customer/Model/Customer/Api.php | 6 +++--- app/code/core/Mage/Dataflow/Model/Batch.php | 4 ++-- app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php | 2 +- app/code/core/Mage/Eav/Model/Entity/Abstract.php | 2 +- .../Mage/ImportExport/Model/Export/Entity/Product.php | 6 +++--- .../Mage/ImportExport/Model/Import/Entity/Customer.php | 2 +- .../Mage/ImportExport/Model/Import/Entity/Product.php | 2 +- app/code/core/Mage/Index/Model/Event.php | 2 +- app/code/core/Mage/Install/Block/Db/Main.php | 2 +- app/code/core/Mage/Install/Model/Installer/Console.php | 2 +- .../core/Mage/Install/Model/Installer/Db/Abstract.php | 2 +- app/code/core/Mage/Page/Block/Template/Links.php | 2 +- app/code/core/Mage/Paygate/Model/Authorizenet.php | 2 +- app/code/core/Mage/Payment/Block/Form/Cc.php | 2 +- app/code/core/Mage/Payment/Helper/Data.php | 6 +++--- .../core/Mage/Paypal/Model/Resource/Report/Settlement.php | 2 +- app/code/core/Mage/Reports/Model/Totals.php | 2 +- app/code/core/Mage/Rule/Model/Action/Abstract.php | 4 ++-- app/code/core/Mage/Rule/Model/Condition/Abstract.php | 6 +++--- app/code/core/Mage/Rule/Model/Condition/Combine.php | 2 +- .../Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php | 2 +- .../Mage/Sales/Model/Resource/Report/Order/Createdat.php | 2 +- .../core/Mage/Sales/Model/Resource/Sale/Collection.php | 2 +- .../sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php | 2 +- .../sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php | 2 +- app/code/core/Mage/Shipping/Model/Rate/Result.php | 2 +- app/code/core/Mage/Tag/Helper/Data.php | 2 +- app/code/core/Mage/Tag/controllers/IndexController.php | 2 +- .../core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php | 2 +- .../Catalog/Product/Attribute/Edit/AttributeForm.php | 2 +- .../Test/Block/Catalog/Product/Edit/Tab/Prices.php | 4 ++-- .../Adminhtml/Test/Block/Catalog/Product/ProductForm.php | 2 +- .../app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php | 4 ++-- .../tests/app/Mage/Bundle/Test/Handler/Curl.php | 4 ++-- .../DeleteOptionsSubStep.php | 2 +- .../app/Mage/Customer/Test/Handler/Customer/Curl.php | 2 +- .../app/Mage/Weee/Test/Constraint/AssertFptApplied.php | 2 +- lib/Varien/Convert/Parser/Csv.php | 4 ++-- lib/Varien/Db/Statement/Pdo/Mysql.php | 2 +- lib/Varien/Http/Adapter/Curl.php | 2 +- lib/Varien/Object.php | 2 +- lib/Varien/Object/Cache.php | 2 +- phpstan.dist.baseline.neon | 5 +++++ 71 files changed, 96 insertions(+), 91 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index afc5f13938c..700d3b3b17d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -215,7 +215,7 @@ public function getChartUrl($directUrl = true) $dateStart->addMonth(1); break; } - foreach (array_keys($this->getAllSeries()) as $index) { + foreach ($this->getAllSeries() as $index => $serie) { if (in_array($d, $this->_axisLabels['x'])) { $datas[$index][] = (float)array_shift($this->_allSeries[$index]); } else { @@ -328,7 +328,7 @@ public function getChartUrl($directUrl = true) if (count($this->_axisLabels)) { $params['chxt'] = implode(',', array_keys($this->_axisLabels)); $indexid = 0; - foreach (array_keys($this->_axisLabels) as $idx) { + foreach ($this->_axisLabels as $idx => $labels) { if ($idx === 'x') { /** * Format date diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php index 20bb44f96f4..d4872f9158d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php @@ -164,7 +164,7 @@ protected function _buildMenuArray(Varien_Simplexml_Element $parent, $path = '', uasort($parentArr, [$this, '_sortMenu']); - foreach (array_keys($parentArr) as $key) { + foreach ($parentArr as $key => $value) { $last = $key; } if (isset($last)) { diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index efc441c2365..180a228a288 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php @@ -207,7 +207,7 @@ protected function _prepareCollection() */ protected function _setFilterValues($data) { - foreach (array_keys($data) as $name) { + foreach ($data as $name => $value) { $this->setFilter($name, $data[$name]); } return $this; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php index 2a585eb5b7d..1e8e12f3dd4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php @@ -62,7 +62,7 @@ protected function _prepareColumns() { $result = parent::_prepareColumns(); - foreach (array_keys($this->_columns) as $key) { + foreach ($this->_columns as $key => $value) { if (in_array($key, $this->_columnsToRemove)) { unset($this->_columns[$key]); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php index 33442aa26b1..d0c60a17406 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php @@ -73,7 +73,7 @@ public function getWebsites() { $websites = Mage::app()->getWebsites(); if ($websiteIds = $this->getWebsiteIds()) { - foreach (array_keys($websites) as $websiteId) { + foreach ($websites as $websiteId => $website) { if (!in_array($websiteId, $websiteIds)) { unset($websites[$websiteId]); } @@ -140,7 +140,7 @@ public function getStores($group) } $stores = $group->getStores(); if ($storeIds = $this->getStoreIds()) { - foreach (array_keys($stores) as $storeId) { + foreach ($stores as $storeId => $store) { if (!in_array($storeId, $storeIds)) { unset($stores[$storeId]); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php index fc959e184ff..9e369a45972 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php @@ -194,7 +194,7 @@ public function getButtonsHtml($area = null) { if ($this->_buttonsHtml === null) { $this->_buttonsHtml = parent::getButtonsHtml(); - foreach (array_keys($this->_children) as $alias) { + foreach ($this->_children as $alias => $child) { if (str_contains($alias, '_button')) { $this->unsetChild($alias); } diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index 955c2f871b0..a91f22b905a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -61,7 +61,7 @@ protected function _prepareForm() 'description' => $model->getDescription(), ]; if ($sessionData = Mage::getSingleton('adminhtml/session')->getData('urlrewrite_data', true)) { - foreach (array_keys($formValues) as $key) { + foreach ($formValues as $key => $value) { if (isset($sessionData[$key])) { $formValues[$key] = $sessionData[$key]; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index 5b701ae5133..af36a237924 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -481,7 +481,7 @@ public function getColumns() */ protected function _setFilterValues($data) { - foreach (array_keys($data) as $columnId) { + foreach ($data as $columnId => $value) { $column = $this->getColumn($columnId); if ($column instanceof Mage_Adminhtml_Block_Widget_Grid_Column && (!empty($data[$columnId]) || strlen($data[$columnId]) > 0) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php index 9bdad27dbbf..1fe5f9905b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php @@ -109,7 +109,7 @@ protected function _toLinkHtml($action, Varien_Object $row) */ protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row) { - foreach (array_keys($action) as $attribute) { + foreach ($action as $attribute => $value) { if (isset($action[$attribute]) && !is_array($action[$attribute])) { $this->getColumn()->setFormat($action[$attribute]); $action[$attribute] = parent::render($row); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php index ca58c8f7fc6..94e9fae48a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php @@ -256,7 +256,7 @@ protected function _reorderTabs() asort($this->_tabPositions); $ordered = []; - foreach (array_keys($this->_tabPositions) as $tabId) { + foreach ($this->_tabPositions as $tabId => $position) { if (isset($this->_tabs[$tabId])) { $tab = $this->_tabs[$tabId]; $ordered[$tabId] = $tab; diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index 92bfd9d0639..e79b3daedc4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -109,7 +109,7 @@ protected function _buildMenuArray(?Varien_Simplexml_Element $parent = null, $pa uasort($parentArr, [$this, '_sortMenu']); - foreach (array_keys($parentArr) as $key) { + foreach ($parentArr as $key => $value) { $last = $key; } if (isset($last)) { diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter.php b/app/code/core/Mage/Api2/Model/Acl/Filter.php index cefef4dd4f6..3494dfceb14 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Filter.php +++ b/app/code/core/Mage/Api2/Model/Acl/Filter.php @@ -61,7 +61,7 @@ public function __construct(Mage_Api2_Model_Resource $resource) */ protected function _filter(array $allowedAttributes, array $data) { - foreach (array_keys($data) as $attribute) { + foreach ($data as $attribute => $value) { if (!in_array($attribute, $allowedAttributes)) { unset($data[$attribute]); } diff --git a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php index f58a244ca00..1016b87c227 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php +++ b/app/code/core/Mage/Api2/Model/Acl/Filter/Attribute/ResourcePermission.php @@ -103,7 +103,7 @@ public function getResourcesPermissions() $resourceModel->setResourceType($resource) ->setUserType($this->_userType); - foreach (array_keys($operations) as $operation) { + foreach ($operations as $operation => $operationLabel) { if (!$this->_hasEntityOnlyAttributes && $config->getResourceEntityOnlyAttributes($resource, $this->_userType, $operation) ) { diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product.php b/app/code/core/Mage/Catalog/Model/Api2/Product.php index f757413be4b..586f1db4acd 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product.php @@ -42,7 +42,7 @@ public function getAvailableAttributes($userType, $operation) } $excludedAttrs = $this->getExcludedAttributes($userType, $operation); $includedAttrs = $this->getIncludedAttributes($userType, $operation); - foreach (array_keys($attributes) as $code) { + foreach ($attributes as $code => $label) { if (in_array($code, $excludedAttrs) || ($includedAttrs && !in_array($code, $includedAttrs))) { unset($attributes[$code]); } diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 5ff10b609dc..58cd0b2c7c9 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -346,7 +346,7 @@ public function getAttributes($noDesignAttributes = false) ->getSortedAttributes(); if ($noDesignAttributes) { - foreach (array_keys($result) as $k) { + foreach ($result as $k => $a) { if (in_array($k, $this->_designAttributes)) { unset($result[$k]); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php index df7d7f731c9..62e6d7f86ae 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php @@ -300,7 +300,7 @@ public function getFormatedTierPrice($qty, $product) { $price = $product->getTierPrice($qty); if (is_array($price)) { - foreach (array_keys($price) as $index) { + foreach ($price as $index => $value) { $price[$index]['formated_price'] = Mage::app()->getStore()->convertPrice( $price[$index]['website_price'], true diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 7e962fb0b72..3a03e409ef5 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -1152,7 +1152,7 @@ protected function _prepareDataForAllFields($category, $replaceFields = []) $table = $this->_getReadAdapter()->describeTable($table); $data = []; $idFieldName = Mage::getSingleton('catalog/category')->getIdFieldName(); - foreach (array_keys($table) as $column) { + foreach ($table as $column => $columnData) { if ($column != $idFieldName || $category->getData($column) !== null) { if (array_key_exists($column, $replaceFields)) { $value = $category->getData($replaceFields[$column]); diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 2cdbe2eec65..f1d8d4a5ced 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -119,7 +119,7 @@ public function initCheckout() $checkout = $this->getCheckout(); $customerSession = $this->getCustomerSession(); if (is_array($checkout->getStepData())) { - foreach (array_keys($checkout->getStepData()) as $step) { + foreach ($checkout->getStepData() as $step => $data) { if (!($step === 'login' || $customerSession->isLoggedIn() && $step === 'billing')) { $checkout->setStepData($step, 'allow', false); } diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php index da23ea014ad..db49ed16933 100644 --- a/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php +++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php @@ -136,7 +136,7 @@ public function attachProductChildrenAttributeMapping(array $parentProducts, $st } // end looping child products } // end looping attributes - foreach (array_keys($mapping) as $key) { + foreach ($mapping as $key => $value) { $mapping[$key]['product_ids'] = array_unique($mapping[$key]['product_ids']); } diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index d3c9a73ac45..73029d7952c 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -603,7 +603,7 @@ public function assocToXml(array $array, $rootName = '_') <$rootName> XML; $xml = new SimpleXMLElement($xmlstr); - foreach (array_keys($array) as $key) { + foreach ($array as $key => $value) { if (is_numeric($key)) { throw new Exception('Array root keys must not be numeric.'); } diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index 9965019bf1e..fe97c2c491f 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -625,7 +625,7 @@ public function getInvalidatedTypes() $types = $this->_getInvalidatedTypes(); if ($types) { $allTypes = $this->getTypes(); - foreach (array_keys($types) as $type) { + foreach ($types as $type => $flag) { if (isset($allTypes[$type]) && $this->canUse($type)) { $invalidatedTypes[$type] = $allTypes[$type]; } diff --git a/app/code/core/Mage/Core/Model/Layout/Validator.php b/app/code/core/Mage/Core/Model/Layout/Validator.php index 2d14731992b..9bedeaf8621 100644 --- a/app/code/core/Mage/Core/Model/Layout/Validator.php +++ b/app/code/core/Mage/Core/Model/Layout/Validator.php @@ -108,7 +108,7 @@ public function getDisallowedBlocks() if (!count($this->_disallowedBlock)) { $disallowedBlockConfig = $this->_getDisallowedBlockConfigValue(); if (is_array($disallowedBlockConfig)) { - foreach (array_keys($disallowedBlockConfig) as $blockName) { + foreach ($disallowedBlockConfig as $blockName => $value) { $this->_disallowedBlock[] = $blockName; } } diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index 2a0c44563c3..d3b70a7c1cd 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -247,7 +247,7 @@ protected function _getOptionLocales($translatedName = false) } } - foreach (array_keys($locales) as $code) { + foreach ($locales as $code => $active) { if (strstr($code, '_')) { if (!in_array($code, $allowed)) { continue; diff --git a/app/code/core/Mage/Core/Model/Log/Adapter.php b/app/code/core/Mage/Core/Model/Log/Adapter.php index 1a173c94d99..3bc190114c0 100644 --- a/app/code/core/Mage/Core/Model/Log/Adapter.php +++ b/app/code/core/Mage/Core/Model/Log/Adapter.php @@ -115,7 +115,7 @@ public function setFilterDataKeys($keys) protected function _filterDebugData($debugData) { if (is_array($debugData) && is_array($this->_debugReplacePrivateDataKeys)) { - foreach (array_keys($debugData) as $key) { + foreach ($debugData as $key => $value) { if (in_array($key, $this->_debugReplacePrivateDataKeys)) { $debugData[$key] = '****'; } else { diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index 929f39be12c..a9bae5f2912 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -319,7 +319,7 @@ protected function _getQueryString() $queryParams = []; parse_str($_SERVER['QUERY_STRING'], $queryParams); $hasChanges = false; - foreach (array_keys($queryParams) as $key) { + foreach ($queryParams as $key => $value) { if (substr($key, 0, 3) === '___') { unset($queryParams[$key]); $hasChanges = true; diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php index f6c14bf4b9a..80bf9ce24de 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php @@ -306,7 +306,7 @@ protected function _getQueryString() $queryParams = []; parse_str($_SERVER['QUERY_STRING'], $queryParams); $hasChanges = false; - foreach (array_keys($queryParams) as $key) { + foreach ($queryParams as $key => $value) { if (substr($key, 0, 3) === '___') { unset($queryParams[$key]); $hasChanges = true; diff --git a/app/code/core/Mage/Customer/Model/Address/Api.php b/app/code/core/Mage/Customer/Model/Address/Api.php index 9f779558882..63120a58f38 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api.php +++ b/app/code/core/Mage/Customer/Model/Address/Api.php @@ -55,7 +55,7 @@ public function items($customerId) $row[$attributeAlias] = $data[$attributeCode] ?? null; } - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { if (isset($data[$attributeCode])) { $row[$attributeCode] = $data[$attributeCode]; } @@ -89,7 +89,7 @@ public function create($customerId, $addressData) $address = Mage::getModel('customer/address'); - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { if (isset($addressData[$attributeCode])) { $address->setData($attributeCode, $addressData[$attributeCode]); } @@ -141,7 +141,7 @@ public function info($addressId) $result[$attributeAlias] = $address->getData($attributeCode); } - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { $result[$attributeCode] = $address->getData($attributeCode); } @@ -169,7 +169,7 @@ public function update($addressId, $addressData) $this->_fault('not_exists'); } - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { if (isset($addressData[$attributeCode])) { $address->setData($attributeCode, $addressData[$attributeCode]); } diff --git a/app/code/core/Mage/Customer/Model/Address/Api/V2.php b/app/code/core/Mage/Customer/Model/Address/Api/V2.php index 901b932eef7..8616fec57a1 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Address/Api/V2.php @@ -40,7 +40,7 @@ public function create($customerId, $addressData) $address = Mage::getModel('customer/address'); - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { if (isset($addressData->$attributeCode)) { $address->setData($attributeCode, $addressData->$attributeCode); } @@ -92,7 +92,7 @@ public function info($addressId) $result[$attributeAlias] = $address->getData($attributeCode); } - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { $result[$attributeCode] = $address->getData($attributeCode); } @@ -120,7 +120,7 @@ public function update($addressId, $addressData) $this->_fault('not_exists'); } - foreach (array_keys($this->getAllowedAttributes($address)) as $attributeCode) { + foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) { if (isset($addressData->$attributeCode)) { $address->setData($attributeCode, $addressData->$attributeCode); } diff --git a/app/code/core/Mage/Customer/Model/Customer/Api.php b/app/code/core/Mage/Customer/Model/Customer/Api.php index f8daaa27a89..16853c6c60e 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api.php @@ -87,7 +87,7 @@ public function info($customerId, $attributes = null) $result[$attributeAlias] = $customer->getData($attributeCode); } - foreach (array_keys($this->getAllowedAttributes($customer, $attributes)) as $attributeCode) { + foreach ($this->getAllowedAttributes($customer, $attributes) as $attributeCode => $attribute) { $result[$attributeCode] = $customer->getData($attributeCode); } @@ -121,7 +121,7 @@ public function items($filters) foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) { $row[$attributeAlias] = $data[$attributeCode] ?? null; } - foreach (array_keys($this->getAllowedAttributes($customer)) as $attributeCode) { + foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) { if (isset($data[$attributeCode])) { $row[$attributeCode] = $data[$attributeCode]; } @@ -149,7 +149,7 @@ public function update($customerId, $customerData) $this->_fault('not_exists'); } - foreach (array_keys($this->getAllowedAttributes($customer)) as $attributeCode) { + foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) { if (isset($customerData[$attributeCode])) { $customer->setData($attributeCode, $customerData[$attributeCode]); } diff --git a/app/code/core/Mage/Dataflow/Model/Batch.php b/app/code/core/Mage/Dataflow/Model/Batch.php index 1235b8f468f..1f727062e73 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Batch.php @@ -92,12 +92,12 @@ public function getFieldList() */ public function parseFieldList($row) { - foreach (array_keys($row) as $fieldName) { + foreach ($row as $fieldName => $value) { if (!in_array($fieldName, $this->_fieldList)) { $this->_fieldList[$fieldName] = $fieldName; } } - unset($fieldName, $row); + unset($fieldName, $value, $row); } /** diff --git a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php index fdf30b8c5f6..1a15c400f15 100644 --- a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php @@ -47,7 +47,7 @@ public function parse() $fields = $line; continue; } else { - foreach (array_keys($line) as $j) { + foreach ($line as $j => $f) { $fields[$j] = 'column' . ($j + 1); } } diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 01c39e4c918..25c93a56c2e 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -1594,7 +1594,7 @@ public function delete($object) ]; $this->_getWriteAdapter()->delete($this->getEntityTable(), $where); $this->loadAllAttributes($object); - foreach (array_keys($this->getAttributesByTable()) as $table) { + foreach ($this->getAttributesByTable() as $table => $attributes) { $this->_getWriteAdapter()->delete($table, $where); } } catch (Exception $e) { diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php index 1ecb2e87b92..91b578e810a 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php @@ -790,7 +790,7 @@ protected function _prepareExport() '_custom_option_row_sku', '_custom_option_row_sort' ]; - foreach (array_keys($this->_storeIdToCode) as &$storeId) { + foreach ($this->_storeIdToCode as $storeId => &$storeCode) { $skip = false; $options = Mage::getResourceModel('catalog/product_option_collection') ->reset() @@ -961,7 +961,7 @@ protected function _prepareExport() $dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); } if (!empty($rowMultiselects[$productId][$storeId])) { - foreach (array_keys($rowMultiselects[$productId][$storeId]) as $attrKey) { + foreach ($rowMultiselects[$productId][$storeId] as $attrKey => $attrVal) { if (isset($rowMultiselects[$productId][$storeId][$attrKey])) { $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$storeId][$attrKey]); } @@ -1039,7 +1039,7 @@ protected function _prepareExport() $dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); } if (!empty($rowMultiselects[$productId][$storeId])) { - foreach (array_keys($rowMultiselects[$productId][$storeId]) as $attrKey) { + foreach ($rowMultiselects[$productId][$storeId] as $attrKey => $attrVal) { if (isset($rowMultiselects[$productId][$storeId][$attrKey])) { $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$storeId][$attrKey]); } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php index 5fc9083546d..6c1771b734e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php @@ -547,7 +547,7 @@ public function getEntityTypeCode() public function getRowScope(array $rowData) { $foundOptions = false; - foreach (array_keys($this->_multiSelectAttributes) as $attrCode) { + foreach ($this->_multiSelectAttributes as $attrCode => $attribute) { if ($rowData[$attrCode]) { $foundOptions = true; } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index 914c5be124f..0a4cf80d21e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -1099,7 +1099,7 @@ protected function _saveCustomOptions() if ($productIds) { // update product entity table to show that product has options $customOptionsProducts = $customOptions['product_id']; - foreach (array_keys($customOptionsProducts) as $key) { + foreach ($customOptionsProducts as $key => $value) { if (!in_array($key, $productIds)) { unset($customOptionsProducts[$key]); } diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index d4dc4468a17..2035a5be359 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -157,7 +157,7 @@ protected function _mergeNewDataRecursive($previous, $current) return $previous; } - foreach (array_keys($previous) as $key) { + foreach ($previous as $key => $value) { if (array_key_exists($key, $current) && !is_null($current[$key]) && is_array($previous[$key])) { if (!is_string($key) || is_array($current[$key])) { $current[$key] = $this->_mergeNewDataRecursive($previous[$key], $current[$key]); diff --git a/app/code/core/Mage/Install/Block/Db/Main.php b/app/code/core/Mage/Install/Block/Db/Main.php index 25791d2f5f8..9f0789c1ea3 100644 --- a/app/code/core/Mage/Install/Block/Db/Main.php +++ b/app/code/core/Mage/Install/Block/Db/Main.php @@ -77,7 +77,7 @@ public function getDatabaseBlock($type) public function getDatabaseBlocks() { $databases = []; - foreach (array_keys($this->_databases) as $type) { + foreach ($this->_databases as $type => $blockData) { $databases[] = $this->getDatabaseBlock($type); } return $databases; diff --git a/app/code/core/Mage/Install/Model/Installer/Console.php b/app/code/core/Mage/Install/Model/Installer/Console.php index 7c31a5007ab..033d8db36a4 100644 --- a/app/code/core/Mage/Install/Model/Installer/Console.php +++ b/app/code/core/Mage/Install/Model/Installer/Console.php @@ -155,7 +155,7 @@ public function setArgs($args = null) /** * Set args values */ - foreach (array_keys($this->_getOptions()) as $name) { + foreach ($this->_getOptions() as $name => $option) { $this->_args[$name] = $args[$name] ?? ''; } diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php index 33b6de0c2ea..40155d07e4a 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php @@ -136,7 +136,7 @@ public function getRequiredExtensions() { $extensions = []; $configExt = (array)Mage::getConfig()->getNode(sprintf('install/databases/%s/extensions', $this->getModel())); - foreach (array_keys($configExt) as $name) { + foreach ($configExt as $name => $value) { $extensions[] = $name; } return $extensions; diff --git a/app/code/core/Mage/Page/Block/Template/Links.php b/app/code/core/Mage/Page/Block/Template/Links.php index aacfd69b27e..b52e2f367eb 100644 --- a/app/code/core/Mage/Page/Block/Template/Links.php +++ b/app/code/core/Mage/Page/Block/Template/Links.php @@ -242,7 +242,7 @@ protected function _getNewPosition($position = 0) } } else { $position = 0; - foreach (array_keys($this->_links) as $k) { + foreach ($this->_links as $k => $v) { $position = $k; } $position += 10; diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index c32a8b69385..5659e2caac3 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -1475,7 +1475,7 @@ protected function _addTransaction( $payment->setTransactionAdditionalInfo($key, $value); } $transaction = $payment->addTransaction($transactionType, null, false, $message); - foreach (array_keys($transactionDetails) as $key) { + foreach ($transactionDetails as $key => $value) { $payment->unsetData($key); } $payment->unsLastTransId(); diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 08a12b4c037..5435e7f4a75 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -47,7 +47,7 @@ public function getCcAvailableTypes() $availableTypes = $method->getConfigData('cctypes'); if ($availableTypes) { $availableTypes = explode(',', $availableTypes); - foreach (array_keys($types) as $code) { + foreach ($types as $code => $name) { if (!in_array($code, $availableTypes)) { unset($types[$code]); } diff --git a/app/code/core/Mage/Payment/Helper/Data.php b/app/code/core/Mage/Payment/Helper/Data.php index fed881ddeae..a7f9071c590 100644 --- a/app/code/core/Mage/Payment/Helper/Data.php +++ b/app/code/core/Mage/Payment/Helper/Data.php @@ -67,7 +67,7 @@ public function getMethodInstance($code) public function getStoreMethods($store = null, $quote = null) { $res = []; - foreach (array_keys($this->getPaymentMethods($store)) as $code) { + foreach ($this->getPaymentMethods($store) as $code => $methodConfig) { $prefix = self::XML_PATH_PAYMENT_METHODS . '/' . $code . '/'; if (!$model = Mage::getStoreConfig($prefix . 'model', $store)) { continue; @@ -166,7 +166,7 @@ public function getBillingAgreementMethods($store = null, $quote = null) public function getRecurringProfileMethods($store = null) { $result = []; - foreach (array_keys($this->getPaymentMethods($store)) as $code) { + foreach ($this->getPaymentMethods($store) as $code => $data) { $paymentMethodModelClassName = $this->getMethodModelClassName($code); if (!$paymentMethodModelClassName) { continue; @@ -244,7 +244,7 @@ public function getPaymentMethodList($sorted = true, $asLabelValue = false, $wit } if ($asLabelValue) { $labelValues = []; - foreach (array_keys($methods) as $code) { + foreach ($methods as $code => $title) { $labelValues[$code] = []; } foreach ($methods as $code => $title) { diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php index fca1a3d661e..ec75245e7e2 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php @@ -58,7 +58,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) /** @var Mage_Core_Model_Date $date */ $date = Mage::getSingleton('core/date'); - foreach (array_keys($rows) as $key) { + foreach ($rows as $key => $row) { /* * Converting dates */ diff --git a/app/code/core/Mage/Reports/Model/Totals.php b/app/code/core/Mage/Reports/Model/Totals.php index 6b98422fdee..33f899cc705 100644 --- a/app/code/core/Mage/Reports/Model/Totals.php +++ b/app/code/core/Mage/Reports/Model/Totals.php @@ -47,7 +47,7 @@ public function countTotals($grid, $from, $to) } $data = $item->getData(); - foreach (array_keys($columns) as $field) { + foreach ($columns as $field => $a) { if ($field !== '') { $columns[$field]['value'] += $data[$field] ?? 0; } diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index d8cb87fb7f4..a810922d2f7 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -52,11 +52,11 @@ public function __construct() parent::__construct(); $this->loadAttributeOptions()->loadOperatorOptions()->loadValueOptions(); - foreach (array_keys($this->getAttributeOption()) as $attr) { + foreach ($this->getAttributeOption() as $attr => $dummy) { $this->setAttribute($attr); break; } - foreach (array_keys($this->getOperatorOption()) as $operator) { + foreach ($this->getOperatorOption() as $operator => $dummy) { $this->setOperator($operator); break; } diff --git a/app/code/core/Mage/Rule/Model/Condition/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Abstract.php index e31fbdda29c..d2e67c86270 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Abstract.php @@ -92,13 +92,13 @@ public function __construct() $this->loadAttributeOptions()->loadOperatorOptions()->loadValueOptions(); if ($options = $this->getAttributeOptions()) { - foreach (array_keys($options) as $attr) { + foreach ($options as $attr => $dummy) { $this->setAttribute($attr); break; } } if ($options = $this->getOperatorOptions()) { - foreach (array_keys($options) as $operator) { + foreach ($options as $operator => $dummy) { $this->setOperator($operator); break; } @@ -503,7 +503,7 @@ public function getTypeElementHtml() public function getAttributeElement() { if (is_null($this->getAttribute())) { - foreach (array_keys($this->getAttributeOption()) as $k) { + foreach ($this->getAttributeOption() as $k => $v) { $this->setAttribute($k); break; } diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index 1d9b0093d13..79d4e693c38 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -95,7 +95,7 @@ public function __construct() $this->loadAggregatorOptions(); if ($options = $this->getAggregatorOptions()) { - foreach (array_keys($options) as $aggregator) { + foreach ($options as $aggregator => $dummy) { $this->setAggregator($aggregator); break; } diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index 713bee21bab..52bf6a9b347 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -125,7 +125,7 @@ protected function _prepareColumns() { $result = parent::_prepareColumns(); - foreach (array_keys($this->_columns) as $key) { + foreach ($this->_columns as $key => $value) { if (in_array($key, $this->_columnsToRemove)) { unset($this->_columns[$key]); } diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php index a9971351972..323ce47e00f 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php @@ -230,7 +230,7 @@ protected function _aggregateByField($aggregationField, $from, $to) $adapter->query($select->insertFromSelect($this->getMainTable(), array_keys($columns))); // setup all columns to select SUM() except period, store_id and order_status - foreach (array_keys($columns) as $k) { + foreach ($columns as $k => $v) { $columns[$k] = new Zend_Db_Expr('SUM(' . $k . ')'); } $columns['period'] = 'period'; diff --git a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php index f2972e84cc9..1bf6ed99bf1 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php @@ -182,7 +182,7 @@ public function load($printQuery = false, $logQuery = false) ->setWebsiteId(Mage::app()->getStore($storeId)->getWebsiteId()) ->setAvgNormalized($v['avgsale'] * $v['num_orders']); $this->_items[$storeId] = $storeObject; - foreach (array_keys($this->_totals) as $key) { + foreach ($this->_totals as $key => $value) { $this->_totals[$key] += $storeObject->getData($key); } } diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php index 9525a968c57..43d089aa854 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -183,7 +183,7 @@ $select->from(['e' => $this->getTable('sales_order_entity')]); $attributeIds = []; -foreach (array_keys($attributes) as $code) { +foreach ($attributes as $code => $params) { $attributes[$code] = $installer->getAttribute($orderEntityTypeId, $code); if ($attributes[$code]['backend_type'] != 'static') { $select->joinLeft( diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php index 69722481f54..3e9e34ea693 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.50-0.9.51.php @@ -46,7 +46,7 @@ "); /* get order_payment attribute codes*/ -foreach (array_keys($attributesIds) as $attributeCode) { +foreach ($attributesIds as $attributeCode => $attributeId) { $attributesIds[$attributeCode] = $connection->fetchOne(" SELECT attribute_id FROM {$this->getTable('eav_attribute')} diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result.php b/app/code/core/Mage/Shipping/Model/Rate/Result.php index bc7ad148a12..fa06daacb29 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result.php @@ -180,7 +180,7 @@ public function sortRatesByPrice() natsort($tmp); - foreach (array_keys($tmp) as $i) { + foreach ($tmp as $i => $price) { $result[] = $this->_rates[$i]; } diff --git a/app/code/core/Mage/Tag/Helper/Data.php b/app/code/core/Mage/Tag/Helper/Data.php index a2de68080cc..c86d4d5eee1 100644 --- a/app/code/core/Mage/Tag/Helper/Data.php +++ b/app/code/core/Mage/Tag/Helper/Data.php @@ -73,7 +73,7 @@ public function extractTags($tagNamesInString) */ public function cleanTags(array $tagNamesArr) { - foreach (array_keys($tagNamesArr) as $key) { + foreach ($tagNamesArr as $key => $tagName) { $tagNamesArr[$key] = trim($tagNamesArr[$key], '\''); $tagNamesArr[$key] = trim($tagNamesArr[$key]); if ($tagNamesArr[$key] == '') { diff --git a/app/code/core/Mage/Tag/controllers/IndexController.php b/app/code/core/Mage/Tag/controllers/IndexController.php index 833837c75b6..54b26c441f7 100644 --- a/app/code/core/Mage/Tag/controllers/IndexController.php +++ b/app/code/core/Mage/Tag/controllers/IndexController.php @@ -99,7 +99,7 @@ protected function _extractTags($tagNamesInString) */ protected function _cleanTags(array $tagNamesArr) { - foreach (array_keys($tagNamesArr) as $key) { + foreach ($tagNamesArr as $key => $tagName) { $tagNamesArr[$key] = trim($tagNamesArr[$key], '\''); $tagNamesArr[$key] = trim($tagNamesArr[$key]); if ($tagNamesArr[$key] == '') { diff --git a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php index f6ed065e028..ed49099010c 100644 --- a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -74,7 +74,7 @@ public function afterLoad($object) { $data = $this->_getResource()->loadProductData($object, $this->getAttribute()); - foreach (array_keys($data) as $i) { + foreach ($data as $i => $row) { if ($data[$i]['website_id'] == 0) { $rate = Mage::app()->getStore()->getBaseCurrency()->getRate(Mage::app()->getBaseCurrencyCode()); if ($rate) { diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php index 1344cfc1a92..9683e4322cd 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php @@ -45,7 +45,7 @@ public function getData(FixtureInterface $fixture = null, Element $element = nul { $data = []; if ($fixture === null) { - foreach (array_keys($this->tabs) as $tabName) { + foreach ($this->tabs as $tabName => $tab) { $this->openTab($tabName); $tabData = $this->getTabElement($tabName)->getDataFormTab(); $data = array_merge($data, $tabData); diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php index 657f84a8239..3346dcc17a8 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php @@ -54,7 +54,7 @@ class Prices extends Tab public function fillFormTab(array $fields, Element $element = null) { $context = $element ? $element : $this->_rootElement; - foreach (array_keys($this->childrenForm) as $key) { + foreach ($this->childrenForm as $key => $value) { if (isset($fields[$key])) { $this->fillOptionsPrices([$key => $fields[$key]], $context); unset($fields[$key]); @@ -91,7 +91,7 @@ public function getDataFormTab($fields = null, Element $element = null) { $result = []; $context = $element ? $element : $this->_rootElement; - foreach (array_keys($this->childrenForm) as $key) { + foreach ($this->childrenForm as $key => $value) { if (isset($fields[$key])) { $result[$key] = $this->getOptionsPrices([$key => $fields[$key]], $context); unset($fields[$key]); diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php index 565b823b7c5..584a8f25fbc 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php @@ -341,7 +341,7 @@ public function getRequireNoticeAttributes(FixtureInterface $product) { $data = []; $tabs = $this->getFieldsByTabs($product); - foreach (array_keys($tabs) as $tabName) { + foreach ($tabs as $tabName => $fields) { $tab = $this->getTabElement($tabName); $this->openTab($tabName); $errors = $tab->getRequireNoticeMessages(); diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php index a0c24f0c42d..8d9596cda76 100644 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php +++ b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php @@ -135,7 +135,7 @@ protected function fillTabs(array $tabs, Element $element = null) */ protected function fillMissedFields() { - foreach (array_keys($this->tabs) as $tabName) { + foreach ($this->tabs as $tabName => $tabData) { $tabElement = $this->getTabElement($tabName); if ($this->openTab($tabName)) { $mapping = $tabElement->dataMapping($this->unassignedFields); @@ -174,7 +174,7 @@ public function getData(FixtureInterface $fixture = null, Element $element = nul $data = []; if (null === $fixture) { - foreach (array_keys($this->tabs) as $tabName) { + foreach ($this->tabs as $tabName => $tab) { $this->openTab($tabName); $tabData = $this->getTabElement($tabName)->getDataFormTab(); $data = array_merge($data, $tabData); diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php index eb79bfc90ef..e4777d9f973 100644 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php +++ b/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php @@ -146,7 +146,7 @@ protected function prepareBundleSelections(array $bundleData) */ protected function prepareItemSelectionData(array $selections, array $products) { - foreach (array_keys($selections) as $key) { + foreach ($selections as $key => $selection) { $selections[$key]['product_id'] = $products[$key]->getId(); unset($selections[$key]['sku']); $selections[$key]['delete'] = ''; @@ -163,7 +163,7 @@ protected function prepareItemSelectionData(array $selections, array $products) */ protected function prepareBundleOptions(array $bundleData) { - foreach (array_keys($bundleData) as $key) { + foreach ($bundleData as $key => $option) { $bundleData[$key] = array_intersect_key($bundleData[$key], array_flip($this->optionsFields)); $bundleData[$key]['delete'] = ''; } diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php index 16d05ab359c..6b18d2b8ea3 100644 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php +++ b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php @@ -86,7 +86,7 @@ protected function searchKeysForOption($optionIndex) { $keys = []; $originalProductAssignedProducts = $this->getOriginalProductAssignedProducts(); - foreach (array_keys($originalProductAssignedProducts) as $key) { + foreach ($originalProductAssignedProducts as $key => $product) { if (strpos($key, 'option_key_' . $optionIndex) !== false) { $keys[] = $key; } diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php index 23d27ff801b..68f2f85b69a 100644 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php +++ b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php @@ -131,7 +131,7 @@ public function persist(FixtureInterface $customer = null) */ protected function checkForUpdateData(array $data) { - foreach (array_keys($data) as $key) { + foreach ($data as $key => $field) { if (in_array($key, $this->updatingFields)) { return true; } diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php index baf99e0e016..c1b61df6d23 100644 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php +++ b/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php @@ -145,7 +145,7 @@ protected function clearShoppingCart() protected function getPrices() { $actualPrices = []; - foreach (array_keys($this->expectedPrices) as $priceType) { + foreach ($this->expectedPrices as $priceType => $prices) { $actualPrices[$priceType] = $this->{'get' . ucfirst($priceType) . 'Price'}(); } diff --git a/lib/Varien/Convert/Parser/Csv.php b/lib/Varien/Convert/Parser/Csv.php index 4550d155691..f857c3b85a8 100644 --- a/lib/Varien/Convert/Parser/Csv.php +++ b/lib/Varien/Convert/Parser/Csv.php @@ -44,7 +44,7 @@ public function parse() $fields = $line; continue; } else { - foreach (array_keys($line) as $j) { + foreach ($line as $j => $f) { $fields[$j] = 'column' . ($j + 1); } } @@ -87,7 +87,7 @@ public function parseTest() $fields = $line; continue; } else { - foreach (array_keys($line) as $j) { + foreach ($line as $j => $f) { $fields[$j] = 'column' . ($j + 1); } } diff --git a/lib/Varien/Db/Statement/Pdo/Mysql.php b/lib/Varien/Db/Statement/Pdo/Mysql.php index d5f83882237..b23cb8435fa 100644 --- a/lib/Varien/Db/Statement/Pdo/Mysql.php +++ b/lib/Varien/Db/Statement/Pdo/Mysql.php @@ -33,7 +33,7 @@ public function _executeWithBinding(array $params) { // Check whether we deal with named bind $isPositionalBind = true; - foreach (array_keys($params) as $k) { + foreach ($params as $k => $v) { if (!is_int($k)) { $isPositionalBind = false; break; diff --git a/lib/Varien/Http/Adapter/Curl.php b/lib/Varien/Http/Adapter/Curl.php index 1e9fd81f16b..56e9359a23f 100644 --- a/lib/Varien/Http/Adapter/Curl.php +++ b/lib/Varien/Http/Adapter/Curl.php @@ -75,7 +75,7 @@ protected function _applyConfig() $verifyHost = isset($this->_config['verifyhost']) ? $this->_config['verifyhost'] : 0; curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYHOST, $verifyHost); - foreach (array_keys($this->_config) as $param) { + foreach ($this->_config as $param => $curlOption) { if (array_key_exists($param, $this->_allowedParams)) { curl_setopt($this->_getResource(), $this->_allowedParams[$param], $this->_config[$param]); } diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index 968d5b0fc02..bfd0f11bcff 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -292,7 +292,7 @@ public function unsetData($key = null) public function unsetOldData($key = null) { if (is_null($key)) { - foreach (array_keys($this->_oldFieldsMap) as $key) { + foreach ($this->_oldFieldsMap as $key => $newFieldName) { unset($this->_data[$key]); } } else { diff --git a/lib/Varien/Object/Cache.php b/lib/Varien/Object/Cache.php index 24047b87356..11b6cc23775 100644 --- a/lib/Varien/Object/Cache.php +++ b/lib/Varien/Object/Cache.php @@ -241,7 +241,7 @@ public function delete($idx) } if (isset($this->_objectReferences[$idx])) { - foreach (array_keys($this->_references) as $r) { + foreach ($this->_references as $r => $dummy) { unset($this->_references[$r]); } unset($this->_objectReferences[$idx]); diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index 21489364a42..8fd0d3944fa 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -3400,6 +3400,11 @@ parameters: count: 1 path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php + - + message: "#^Offset int\\|string on non\\-empty\\-array\\ in isset\\(\\) always exists and is not nullable\\.$#" + count: 2 + path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php + - message: "#^Variable \\$collection might not be defined\\.$#" count: 1 From 464bc5ff4e71b08ae7588e3358381d710e99f2e8 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 28 Jul 2024 02:58:59 +0200 Subject: [PATCH 3/7] Drop php7 support - updated workflows - phpstan baseline (will be fixed later) --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/phpcs.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/release.yml | 6 +- .github/workflows/sonar.yml | 2 +- .github/workflows/syntax-php.yml | 2 +- composer.json | 6 +- composer.lock | 409 +++++++++++++++-------------- phpstan.dist.baseline.neon | 59 +++-- 9 files changed, 255 insertions(+), 235 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index c340b673359..4684fbd29f1 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -14,7 +14,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index e078a040ebe..52da74a0655 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -24,7 +24,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index ec6fedd1359..880ca446948 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['7.4', '8.3'] + php-versions: ['8.0', '8.3'] steps: - name: Setup PHP diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a3b20bfb73..4cc52dc02d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['7.4'] + php-versions: ['8.0'] steps: - name: Checkout repository uses: actions/checkout@master @@ -38,6 +38,10 @@ jobs: if: startsWith(github.event.release.tag_name, 'v19') run: composer require --no-install --prefer-dist --no-progress --ignore-platform-req=ext-* openmage/module-mage-pagecache + - name: Require Mage_Poll on v19 + if: startsWith(github.event.release.tag_name, 'v19') + run: composer require --no-install --prefer-dist --no-progress --ignore-platform-req=ext-* openmage/module-mage-poll + - name: Composer install run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-* --no-dev diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index cc2ffcb5d43..b5b9a843b5e 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -16,7 +16,7 @@ jobs: max-parallel: 5 matrix: os: [ubuntu-latest] - php: ['7.4', '8.1'] + php: ['8.0', '8.3'] steps: - uses: actions/checkout@v4 - name: Setup PHP diff --git a/.github/workflows/syntax-php.yml b/.github/workflows/syntax-php.yml index 3c5755ed6a3..df0a92c060c 100644 --- a/.github/workflows/syntax-php.yml +++ b/.github/workflows/syntax-php.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - php: ['7.4', '8.3'] + php: ['8.0', '8.3'] name: PHP Syntax ${{ matrix.php }} diff --git a/composer.json b/composer.json index a63c329cfb3..3a9a1040141 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,14 @@ { "name": "openmage/magento-lts", "description": "A fork of Magento-1 that is accepting bug fixes (backward compatible, drop in replacement for official Magento)", + "homepage": "https://www.openmage.org/", "license": [ "OSL-3.0", "AFL-3.0" ], "type": "magento-source", "require": { - "php": ">=7.4 <8.5", + "php": ">=8.0 <8.5", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", @@ -31,7 +32,6 @@ "phpseclib/mcrypt_compat": "^2.0.3", "phpseclib/phpseclib": "^3.0.14", "shardj/zf1-future": "1.24.0", - "symfony/polyfill-php74": "^1.29", "symfony/polyfill-php80": "^1.29", "symfony/polyfill-php81": "^1.29", "symfony/polyfill-php82": "^1.29" @@ -120,7 +120,7 @@ "cweagans/composer-patches": true }, "platform": { - "php": "7.4" + "php": "8.0" }, "sort-packages": true } diff --git a/composer.lock b/composer.lock index e74fd77527b..5c7c7c3375f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "40e9d3cfc444bb72b7cf7754c735f694", + "content-hash": "f02717d060455eadf0ec5ddce4f9e482", "packages": [ { "name": "colinmollenhour/cache-backend-redis", @@ -53,16 +53,16 @@ }, { "name": "colinmollenhour/credis", - "version": "v1.16.0", + "version": "v1.16.1", "source": { "type": "git", "url": "https://github.com/colinmollenhour/credis.git", - "reference": "5641140e14a9679f5a6f66c97268727f9558b881" + "reference": "f11a89fd068d3e5db0c2b5a9ba8663bc36162e95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/5641140e14a9679f5a6f66c97268727f9558b881", - "reference": "5641140e14a9679f5a6f66c97268727f9558b881", + "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/f11a89fd068d3e5db0c2b5a9ba8663bc36162e95", + "reference": "f11a89fd068d3e5db0c2b5a9ba8663bc36162e95", "shasum": "" }, "require": { @@ -94,9 +94,9 @@ "homepage": "https://github.com/colinmollenhour/credis", "support": { "issues": "https://github.com/colinmollenhour/credis/issues", - "source": "https://github.com/colinmollenhour/credis/tree/v1.16.0" + "source": "https://github.com/colinmollenhour/credis/tree/v1.16.1" }, - "time": "2023-10-26T17:02:51+00:00" + "time": "2024-07-04T15:08:03+00:00" }, { "name": "colinmollenhour/magento-redis-session", @@ -139,7 +139,7 @@ }, { "name": "colinmollenhour/php-redis-session-abstract", - "version": "v1.5.5", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/colinmollenhour/php-redis-session-abstract.git", @@ -177,7 +177,7 @@ "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract", "support": { "issues": "https://github.com/colinmollenhour/php-redis-session-abstract/issues", - "source": "https://github.com/colinmollenhour/php-redis-session-abstract/tree/v1.5.5" + "source": "https://github.com/colinmollenhour/php-redis-session-abstract/tree/v1.7.0" }, "time": "2024-02-03T06:04:45+00:00" }, @@ -402,20 +402,20 @@ }, { "name": "justinrainbow/json-schema", - "version": "v5.2.13", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", @@ -426,11 +426,6 @@ "bin/validate-json" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, "autoload": { "psr-4": { "JsonSchema\\": "src/JsonSchema/" @@ -465,10 +460,10 @@ "schema" ], "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" }, - "time": "2023-09-26T02:20:38+00:00" + "time": "2024-07-06T21:00:26+00:00" }, { "name": "magento-hackathon/magento-composer-installer", @@ -571,24 +566,24 @@ }, { "name": "paragonie/constant_time_encoding", - "version": "v2.7.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105" + "reference": "df1e7fde177501eee2037dd159cf04f5f301a512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/52a0d99e69f56b9ec27ace92ba56897fe6993105", - "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/df1e7fde177501eee2037dd159cf04f5f301a512", + "reference": "df1e7fde177501eee2037dd159cf04f5f301a512", "shasum": "" }, "require": { - "php": "^7|^8" + "php": "^8" }, "require-dev": { - "phpunit/phpunit": "^6|^7|^8|^9", - "vimeo/psalm": "^1|^2|^3|^4" + "phpunit/phpunit": "^9", + "vimeo/psalm": "^4|^5" }, "type": "library", "autoload": { @@ -634,7 +629,7 @@ "issues": "https://github.com/paragonie/constant_time_encoding/issues", "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2024-05-08T12:18:48+00:00" + "time": "2024-05-08T12:36:18+00:00" }, { "name": "paragonie/random_compat", @@ -992,16 +987,16 @@ }, { "name": "sabberworm/php-css-parser", - "version": "8.5.0", + "version": "v8.6.0", "source": { "type": "git", "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", - "reference": "4e9a54c2a368fcd73ecc6b45f98c7714b54a7db0" + "reference": "d2fb94a9641be84d79c7548c6d39bbebba6e9a70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/4e9a54c2a368fcd73ecc6b45f98c7714b54a7db0", - "reference": "4e9a54c2a368fcd73ecc6b45f98c7714b54a7db0", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/d2fb94a9641be84d79c7548c6d39bbebba6e9a70", + "reference": "d2fb94a9641be84d79c7548c6d39bbebba6e9a70", "shasum": "" }, "require": { @@ -1009,7 +1004,6 @@ "php": ">=5.6.20" }, "require-dev": { - "codacy/coverage": "^1.4.3", "phpunit/phpunit": "^5.7.27" }, "suggest": { @@ -1018,7 +1012,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.0.x-dev" + "dev-main": "9.0.x-dev" } }, "autoload": { @@ -1033,6 +1027,14 @@ "authors": [ { "name": "Raphael Schweikert" + }, + { + "name": "Oliver Klee", + "email": "github@oliverklee.de" + }, + { + "name": "Jake Hotson", + "email": "jake.github@qzdesign.co.uk" } ], "description": "Parser for CSS Files written in PHP", @@ -1044,9 +1046,9 @@ ], "support": { "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", - "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/8.5.0" + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.6.0" }, - "time": "2024-02-01T00:40:08+00:00" + "time": "2024-07-01T07:33:21+00:00" }, { "name": "shardj/zf1-future", @@ -1112,16 +1114,16 @@ }, { "name": "symfony/console", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", "shasum": "" }, "require": { @@ -1191,7 +1193,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.40" + "source": "https://github.com/symfony/console/tree/v5.4.42" }, "funding": [ { @@ -1207,20 +1209,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-26T12:21:55+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.35", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "9e615d367e2bed41f633abb383948c96a2dbbfae" + "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/9e615d367e2bed41f633abb383948c96a2dbbfae", - "reference": "9e615d367e2bed41f633abb383948c96a2dbbfae", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", + "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", "shasum": "" }, "require": { @@ -1257,7 +1259,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.35" + "source": "https://github.com/symfony/css-selector/tree/v5.4.40" }, "funding": [ { @@ -1273,7 +1275,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1344,16 +1346,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -1403,7 +1405,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -1419,20 +1421,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -1481,7 +1483,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -1497,20 +1499,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -1562,7 +1564,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -1578,20 +1580,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -1642,7 +1644,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -1658,20 +1660,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -1718,7 +1720,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -1734,7 +1736,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php74", @@ -2130,16 +2132,16 @@ }, { "name": "symfony/string", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143" + "reference": "909cec913edea162a3b2836788228ad45fcab337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/142877285aa974a6f7685e292ab5ba9aae86b143", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143", + "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", + "reference": "909cec913edea162a3b2836788228ad45fcab337", "shasum": "" }, "require": { @@ -2196,7 +2198,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.40" + "source": "https://github.com/symfony/string/tree/v5.4.42" }, "funding": [ { @@ -2212,7 +2214,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-20T18:38:32+00:00" } ], "packages-dev": [ @@ -2282,30 +2284,38 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90", + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.8", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -2333,7 +2343,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.2.0" }, "funding": [ { @@ -2349,20 +2359,20 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-07-25T09:36:02+00:00" }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -2414,7 +2424,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -2430,7 +2440,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/xdebug-handler", @@ -2756,16 +2766,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.60.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e595e4e070d17c5d42ed8c4206f630fcc5f401a4", + "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4", "shasum": "" }, "require": { @@ -2847,7 +2857,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.60.0" }, "funding": [ { @@ -2855,7 +2865,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2024-07-25T09:26:51+00:00" }, { "name": "macopedia/phpstan-magento1", @@ -2935,16 +2945,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -2952,11 +2962,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -2982,7 +2993,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -2990,20 +3001,20 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", "shasum": "" }, "require": { @@ -3014,7 +3025,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -3046,9 +3057,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2024-07-01T20:03:41+00:00" }, { "name": "openmage/dev-copyright", @@ -3486,16 +3497,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.5", + "version": "1.11.8", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "490f0ae1c92b082f154681d7849aee776a7c1443" + "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/490f0ae1c92b082f154681d7849aee776a7c1443", - "reference": "490f0ae1c92b082f154681d7849aee776a7c1443", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", + "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", "shasum": "" }, "require": { @@ -3540,7 +3551,7 @@ "type": "github" } ], - "time": "2024-06-17T15:10:54+00:00" + "time": "2024-07-24T07:01:22+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3863,45 +3874,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "9.6.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "49d7820565836236411f5dc002d16dd689cde42f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", + "reference": "49d7820565836236411f5dc002d16dd689cde42f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -3946,7 +3957,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" }, "funding": [ { @@ -3962,7 +3973,7 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2024-07-10T11:45:39+00:00" }, { "name": "psr/event-dispatcher", @@ -4016,30 +4027,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4060,9 +4071,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/2.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:41:46+00:00" }, { "name": "react/cache", @@ -4438,31 +4449,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -4506,7 +4517,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -4514,7 +4525,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -5559,16 +5570,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.1", + "version": "3.10.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { @@ -5635,20 +5646,20 @@ "type": "open_collective" } ], - "time": "2024-05-22T21:24:41+00:00" + "time": "2024-07-21T23:26:44+00:00" }, { "name": "symfony/config", - "version": "v5.4.35", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "6b763438a22a4f20885e994ad6702f6a3f25430e" + "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/6b763438a22a4f20885e994ad6702f6a3f25430e", - "reference": "6b763438a22a4f20885e994ad6702f6a3f25430e", + "url": "https://api.github.com/repos/symfony/config/zipball/d4e1db78421163b98dd9971d247fd0df4a57ee5e", + "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e", "shasum": "" }, "require": { @@ -5698,7 +5709,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.35" + "source": "https://github.com/symfony/config/tree/v5.4.40" }, "funding": [ { @@ -5714,20 +5725,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.35", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "45474d527212ca67cdb93f6c5e6da68f4bc67118" + "reference": "c8409889fdbf48b99271930ea0ebcf3ee5e1ceae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/45474d527212ca67cdb93f6c5e6da68f4bc67118", - "reference": "45474d527212ca67cdb93f6c5e6da68f4bc67118", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c8409889fdbf48b99271930ea0ebcf3ee5e1ceae", + "reference": "c8409889fdbf48b99271930ea0ebcf3ee5e1ceae", "shasum": "" }, "require": { @@ -5787,7 +5798,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.35" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.42" }, "funding": [ { @@ -5803,7 +5814,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:37:36+00:00" + "time": "2024-07-25T13:57:40+00:00" }, { "name": "symfony/event-dispatcher", @@ -5971,16 +5982,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.40", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995" + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/26dd9912df6940810ea00f8f53ad48d6a3424995", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", "shasum": "" }, "require": { @@ -6018,7 +6029,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.40" + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" }, "funding": [ { @@ -6034,20 +6045,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-06-28T09:36:24+00:00" }, { "name": "symfony/finder", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + "reference": "0724c51fa067b198e36506d2864e09a52180998a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", + "reference": "0724c51fa067b198e36506d2864e09a52180998a", "shasum": "" }, "require": { @@ -6081,7 +6092,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.40" + "source": "https://github.com/symfony/finder/tree/v5.4.42" }, "funding": [ { @@ -6097,7 +6108,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-22T08:53:29+00:00" }, { "name": "symfony/options-resolver", @@ -6392,7 +6403,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.4 <8.5", + "php": ">=8.0 <8.5", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", @@ -6410,7 +6421,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "7.4" + "php": "8.0" }, "plugin-api-version": "2.6.0" } diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index 8fd0d3944fa..5f5091d9d91 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -795,6 +795,11 @@ parameters: count: 1 path: app/code/core/Mage/Api/Model/Wsdl/Config/Element.php + - + message: "#^Return type \\(array\\) of method Mage_Api_Model_Wsdl_Config_Element\\:\\:getChildren\\(\\) should be compatible with return type \\(RecursiveIterator\\|null\\) of method RecursiveIterator\\\\:\\:getChildren\\(\\)$#" + count: 1 + path: app/code/core/Mage/Api/Model/Wsdl/Config/Element.php + - message: "#^Property Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource\\:\\:\\$_treeModel \\(Mage_Api2_Model_Acl_Global_Rule_Tree\\) does not accept default value of type false\\.$#" count: 1 @@ -3410,11 +3415,6 @@ parameters: count: 1 path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - - message: "#^Binary operation \"\\+\" between string and 50\\|int\\<100, max\\> results in an error\\.$#" - count: 1 - path: app/code/core/Mage/ImportExport/Model/Import.php - - message: "#^Property Mage_ImportExport_Model_Import\\:\\:\\$_entityAdapter \\(Mage_ImportExport_Model_Import_Entity_Abstract\\) does not accept Mage_Core_Model_Abstract\\|false\\.$#" count: 1 @@ -3680,6 +3680,16 @@ parameters: count: 2 path: app/code/core/Mage/Log/Model/Resource/Log.php + - + message: "#^Method Mage_Media_Model_File_Image\\:\\:getImage\\(\\) should return bool\\|resource but returns GdImage\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Method Mage_Media_Model_File_Image\\:\\:getTmpImage\\(\\) should return resource but returns \\(GdImage\\|false\\)\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + - message: "#^Call to function is_null\\(\\) with bool will always evaluate to false\\.$#" count: 1 @@ -5052,12 +5062,12 @@ parameters: - message: "#^Method Mage_Usa_Model_Shipping_Carrier_Usps\\:\\:_parseXmlResponse\\(\\) should return Mage_Shipping_Model_Rate_Result but return statement is missing\\.$#" - count: 1 + count: 2 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php - message: "#^Method Mage_Usa_Model_Shipping_Carrier_Usps\\:\\:_parseXmlTrackingResponse\\(\\) should return null but return statement is missing\\.$#" - count: 1 + count: 2 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php - @@ -5200,11 +5210,6 @@ parameters: count: 1 path: lib/Mage/DB/Mysqli.php - - - message: "#^Property Mage_HTTP_Client_Curl\\:\\:\\$_ch \\(object\\) does not accept resource\\.$#" - count: 1 - path: lib/Mage/HTTP/Client/Curl.php - - message: "#^Property Mage_HTTP_Client_Socket\\:\\:\\$_postFields is never read, only written\\.$#" count: 1 @@ -5335,6 +5340,11 @@ parameters: count: 1 path: lib/Varien/Db/Adapter/Mysqli.php + - + message: "#^Call to function is_null\\(\\) with non\\-empty\\-string will always evaluate to false\\.$#" + count: 2 + path: lib/Varien/Db/Adapter/Pdo/Mysql.php + - message: "#^Cannot access offset 'Engine' on bool\\.$#" count: 1 @@ -5355,6 +5365,16 @@ parameters: count: 1 path: lib/Varien/Db/Adapter/Pdo/Mysql.php + - + message: "#^Offset 1 on array\\{0\\: string, 1\\: non\\-empty\\-string, 2\\: string, 3\\: non\\-empty\\-string, 4\\: string, 5\\: non\\-empty\\-string, 6\\?\\: non\\-empty\\-string, 7\\?\\: non\\-empty\\-string, \\.\\.\\.\\} on left side of \\?\\? always exists and is not nullable\\.$#" + count: 1 + path: lib/Varien/Db/Adapter/Pdo/Mysql.php + + - + message: "#^Offset 1 on array\\{0\\: string, 1\\: non\\-empty\\-string, 2\\: string, 3\\: non\\-empty\\-string, 4\\: string, 5\\: non\\-empty\\-string, 6\\?\\: non\\-empty\\-string\\} on left side of \\?\\? always exists and is not nullable\\.$#" + count: 1 + path: lib/Varien/Db/Adapter/Pdo/Mysql.php + - message: "#^Property Varien_Db_Adapter_Pdo_Mysql\\:\\:\\$_cacheAdapter \\(Zend_Cache_Core\\) does not accept Zend_Cache_Backend_Interface\\.$#" count: 1 @@ -5400,21 +5420,6 @@ parameters: count: 1 path: lib/Varien/Filter/Template/Tokenizer/Variable.php - - - message: "#^Method Varien_Http_Adapter_Curl\\:\\:_getResource\\(\\) has invalid return type CurlHandle\\.$#" - count: 1 - path: lib/Varien/Http/Adapter/Curl.php - - - - message: "#^Property Varien_Http_Adapter_Curl\\:\\:\\$_resource has unknown class CurlHandle as its type\\.$#" - count: 1 - path: lib/Varien/Http/Adapter/Curl.php - - - - message: "#^Property Varien_Image_Adapter_Abstract\\:\\:\\$_imageHandler has unknown class GdImage as its type\\.$#" - count: 1 - path: lib/Varien/Image/Adapter/Abstract.php - - message: "#^Call to an undefined method SimpleXMLElement\\:\\:setNode\\(\\)\\.$#" count: 1 From 28d6783a61935b49487a39c6c366636c01d35152 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 28 Jul 2024 03:19:47 +0200 Subject: [PATCH 4/7] Updated README.md (draft) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9ee0ebaccb..734661f8c97 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ In a nutshell: ## Requirements -- PHP 7.4 to 8.3 +- PHP 8.0 to 8.4 - MySQL 5.7+ (8.0+ recommended) or MariaDB - optional: Redis 5.x, 6.x and 7.0.x are supported @@ -263,6 +263,10 @@ If you see SQL errors after upgrading please remember to check for this specific UPS shut down their old CGI APIs so we removed the support for it from the Mage_Usa module. +### Since OpenMage 20.11.0 + +PHP 8.0 is now the minimum required version. + ### Between OpenMage 20.x and 21.x (unreleased, available on branch `next`) - PHP 8.2 as minimum required version From 0df34c370f4a4735483130d056a1abebdc431a63 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Wed, 7 Aug 2024 06:09:59 +0200 Subject: [PATCH 5/7] Update composer.json Co-authored-by: Ng Kiat Siong --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3a9a1040141..1ace7df6c19 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "shardj/zf1-future": "1.24.0", "symfony/polyfill-php80": "^1.29", "symfony/polyfill-php81": "^1.29", - "symfony/polyfill-php82": "^1.29" + "symfony/polyfill-php82": "^1.29", + "symfony/polyfill-php83": "^1.29" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", From e0ad5acd7ce123991c07de4fb10c34f290f2a875 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Thu, 5 Sep 2024 01:18:33 +0200 Subject: [PATCH 6/7] Update --- app/code/core/Mage/Install/etc/install.xml | 1 + app/code/core/Mage/Media/Model/File/Image.php | 4 +-- composer.json | 1 + composer.lock | 3 +- lib/Varien/Io/Ftp.php | 2 +- phpstan.dist.baseline.neon | 30 +++++++------------ 6 files changed, 17 insertions(+), 24 deletions(-) diff --git a/app/code/core/Mage/Install/etc/install.xml b/app/code/core/Mage/Install/etc/install.xml index 99c8debe638..5f9947eceb8 100644 --- a/app/code/core/Mage/Install/etc/install.xml +++ b/app/code/core/Mage/Install/etc/install.xml @@ -69,6 +69,7 @@ + diff --git a/app/code/core/Mage/Media/Model/File/Image.php b/app/code/core/Mage/Media/Model/File/Image.php index 298d3c0ab98..99590132268 100644 --- a/app/code/core/Mage/Media/Model/File/Image.php +++ b/app/code/core/Mage/Media/Model/File/Image.php @@ -80,7 +80,7 @@ public function delete(Mage_Media_Model_Image $object) * Create image resource for operation from file * * @param Mage_Media_Model_Image $object - * @return bool|false|resource + * @return false|GdImage|resource * @throws Mage_Core_Exception */ public function getImage(Mage_Media_Model_Image $object) @@ -116,7 +116,7 @@ public function getImage(Mage_Media_Model_Image $object) * Create tmp image resource for operations * * @param Mage_Media_Model_Image $object - * @return resource + * @return GdImage|false */ public function getTmpImage(Mage_Media_Model_Image $object) { diff --git a/composer.json b/composer.json index e0eb3944717..e24fc792ea1 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", + "ext-ftp": "*", "ext-gd": "*", "ext-hash": "*", "ext-iconv": "*", diff --git a/composer.lock b/composer.lock index eed1297fd2b..b4c9f064398 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "649453042df9b760774eaf67a2be5b41", + "content-hash": "66cb860b00d38c5c7f095ad687ce2ae2", "packages": [ { "name": "colinmollenhour/cache-backend-redis", @@ -6540,6 +6540,7 @@ "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", + "ext-ftp": "*", "ext-gd": "*", "ext-hash": "*", "ext-iconv": "*", diff --git a/lib/Varien/Io/Ftp.php b/lib/Varien/Io/Ftp.php index f0a20d51e77..b8d8b82ecdb 100644 --- a/lib/Varien/Io/Ftp.php +++ b/lib/Varien/Io/Ftp.php @@ -39,7 +39,7 @@ class Varien_Io_Ftp extends Varien_Io_Abstract /** * An FTP connection * - * @var resource + * @var FTP\Connection|false */ protected $_conn; diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index b417687de7d..f595921f973 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -780,6 +780,11 @@ parameters: count: 1 path: app/code/core/Mage/Api/Model/Wsdl/Config/Element.php + - + message: "#^Return type \\(array\\) of method Mage_Api_Model_Wsdl_Config_Element\\:\\:getChildren\\(\\) should be compatible with return type \\(RecursiveIterator\\|null\\) of method RecursiveIterator\\\\:\\:getChildren\\(\\)$#" + count: 1 + path: app/code/core/Mage/Api/Model/Wsdl/Config/Element.php + - message: "#^Property Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource\\:\\:\\$_treeModel \\(Mage_Api2_Model_Acl_Global_Rule_Tree\\) does not accept default value of type false\\.$#" count: 1 @@ -3965,6 +3970,11 @@ parameters: count: 1 path: app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php + - + message: "#^Negated boolean expression is always true\\.$#" + count: 1 + path: app/code/core/Mage/Sales/Model/Order.php + - message: "#^Variable \\$oldArea might not be defined\\.$#" count: 1 @@ -4865,11 +4875,6 @@ parameters: count: 1 path: lib/Mage/DB/Mysqli.php - - - message: "#^Property Mage_HTTP_Client_Curl\\:\\:\\$_ch \\(object\\) does not accept resource\\.$#" - count: 1 - path: lib/Mage/HTTP/Client/Curl.php - - message: "#^Property Mage_HTTP_Client_Socket\\:\\:\\$_postFields is never read, only written\\.$#" count: 1 @@ -5065,21 +5070,6 @@ parameters: count: 1 path: lib/Varien/Filter/Template/Tokenizer/Variable.php - - - message: "#^Method Varien_Http_Adapter_Curl\\:\\:_getResource\\(\\) has invalid return type CurlHandle\\.$#" - count: 1 - path: lib/Varien/Http/Adapter/Curl.php - - - - message: "#^Property Varien_Http_Adapter_Curl\\:\\:\\$_resource has unknown class CurlHandle as its type\\.$#" - count: 1 - path: lib/Varien/Http/Adapter/Curl.php - - - - message: "#^Property Varien_Image_Adapter_Abstract\\:\\:\\$_imageHandler has unknown class GdImage as its type\\.$#" - count: 1 - path: lib/Varien/Image/Adapter/Abstract.php - - message: "#^Call to an undefined method SimpleXMLElement\\:\\:setNode\\(\\)\\.$#" count: 1 From 7da2e882bd9eb40d24b2de5404c9497bde3ac985 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 29 Oct 2024 23:38:27 +0100 Subject: [PATCH 7/7] update baseline --- .phpstan.dist.baseline.neon | 250 ++++++++++++++++++++++++------------ 1 file changed, 165 insertions(+), 85 deletions(-) diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon index 340faf78bcc..113def4f8c6 100644 --- a/.phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -516,7 +516,7 @@ parameters: path: app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php - - message: "#^Parameter \\#2 \\$character_mask of function rtrim expects string, int given\\.$#" + message: "#^Parameter \\#2 \\$characters of function rtrim expects string, int given\\.$#" count: 1 path: app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php @@ -686,7 +686,7 @@ parameters: path: app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php - - message: "#^Parameter \\#2 \\$str of function explode expects string, array given\\.$#" + message: "#^Parameter \\#2 \\$string of function explode expects string, array given\\.$#" count: 1 path: app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -776,7 +776,7 @@ parameters: path: app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php - - message: "#^Parameter \\#2 \\$timestamp of function date expects int, array\\|bool given\\.$#" + message: "#^Parameter \\#2 \\$timestamp of function date expects int\\|null, array\\|bool given\\.$#" count: 1 path: app/code/core/Mage/Adminhtml/controllers/CustomerController.php @@ -865,6 +865,11 @@ parameters: count: 2 path: app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php + - + message: "#^Parameter \\#2 \\$enable of function imageinterlace expects bool\\|null, int given\\.$#" + count: 1 + path: app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php + - message: "#^Method Mage_Adminhtml_Controller_Action\\:\\:_setForcedFormKeyActions\\(\\) invoked with 2 parameters, 1 required\\.$#" count: 1 @@ -996,7 +1001,7 @@ parameters: path: app/code/core/Mage/Api/Model/Server/Adapter/Soap.php - - message: "#^Parameter \\#1 \\$code of class SoapFault constructor expects string, int given\\.$#" + message: "#^Parameter \\#1 \\$code of class SoapFault constructor expects array\\|string\\|null, int given\\.$#" count: 1 path: app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -1041,7 +1046,7 @@ parameters: path: app/code/core/Mage/Api/Model/Server/V2/Handler.php - - message: "#^Parameter \\#2 \\$needle of function str_contains expects string\\|null, array given\\.$#" + message: "#^Parameter \\#2 \\$needle of function str_contains expects string, array given\\.$#" count: 1 path: app/code/core/Mage/Api/Model/Server/V2/Handler.php @@ -1071,7 +1076,7 @@ parameters: path: app/code/core/Mage/Api/Model/Server/Wsi/Handler.php - - message: "#^Parameter \\#2 \\$needle of function str_contains expects string\\|null, array given\\.$#" + message: "#^Parameter \\#2 \\$needle of function str_contains expects string, array given\\.$#" count: 1 path: app/code/core/Mage/Api/Model/Server/Wsi/Handler.php @@ -1110,6 +1115,11 @@ parameters: count: 1 path: app/code/core/Mage/Api/Model/Wsdl/Config/Element.php + - + message: "#^Return type \\(array\\) of method Mage_Api_Model_Wsdl_Config_Element\\:\\:getChildren\\(\\) should be compatible with return type \\(RecursiveIterator\\|null\\) of method RecursiveIterator\\\\:\\:getChildren\\(\\)$#" + count: 1 + path: app/code/core/Mage/Api/Model/Wsdl/Config/Element.php + - message: "#^Parameter \\#1 \\$collection of method Mage_Adminhtml_Block_Widget_Grid\\:\\:setCollection\\(\\) expects Varien_Data_Collection_Db, Varien_Data_Collection given\\.$#" count: 1 @@ -1231,7 +1241,7 @@ parameters: path: app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, false given\\.$#" + message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, false given\\.$#" count: 1 path: app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php @@ -1596,12 +1606,7 @@ parameters: path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - message: "#^Parameter \\#1 \\$array_arg of function current expects array\\|object, null given\\.$#" - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - - - message: "#^Parameter \\#1 \\$input of function array_keys expects array, string given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_keys expects array, string given\\.$#" count: 1 path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php @@ -1876,7 +1881,7 @@ parameters: path: app/code/core/Mage/Catalog/Model/Category/Api.php - - message: "#^Parameter \\#1 \\$stack of function array_pop is passed by reference, so it expects variables only\\.$#" + message: "#^Parameter \\#1 \\$array of function array_pop is passed by reference, so it expects variables only\\.$#" count: 1 path: app/code/core/Mage/Catalog/Model/Category/Api.php @@ -2631,12 +2636,7 @@ parameters: path: app/code/core/Mage/Catalog/Model/Resource/Product/Website.php - - message: "#^Parameter \\#1 \\$input of function array_reverse expects array, string given\\.$#" - count: 1 - path: app/code/core/Mage/Catalog/Model/Resource/Setup.php - - - - message: "#^Parameter \\#2 \\$pieces of function implode expects array, null given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_reverse expects array, string given\\.$#" count: 1 path: app/code/core/Mage/Catalog/Model/Resource/Setup.php @@ -3171,7 +3171,7 @@ parameters: path: app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php - - message: "#^Parameter \\#1 \\$stack of function array_unshift expects array, null given\\.$#" + message: "#^Parameter \\#1 \\$array of function array_unshift expects array, null given\\.$#" count: 1 path: app/code/core/Mage/ConfigurableSwatches/Model/System/Config/Source/Catalog/Product/Configattribute/Select.php @@ -3295,11 +3295,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Helper/Abstract.php - - - message: "#^Parameter \\#3 \\$encoding of function htmlspecialchars expects string, null given\\.$#" - count: 1 - path: app/code/core/Mage/Core/Helper/Abstract.php - - message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(string\\)\\: bool\\)\\|null, 'trim' given\\.$#" count: 1 @@ -4060,11 +4055,6 @@ parameters: count: 1 path: app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php - - - message: "#^Parameter \\#2 \\$class_name of function simplexml_load_string expects string, null given\\.$#" - count: 1 - path: app/code/core/Mage/Dataflow/Model/Profile.php - - message: "#^Right side of && is always true\\.$#" count: 1 @@ -4115,11 +4105,6 @@ parameters: count: 1 path: app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php - - - message: "#^Parameter \\#2 \\$class_name of function simplexml_load_string expects string, null given\\.$#" - count: 1 - path: app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php - - message: "#^Parameter \\#1 \\$modelClass of static method Mage\\:\\:getModel\\(\\) expects string, array given\\.$#" count: 1 @@ -4151,7 +4136,7 @@ parameters: path: app/code/core/Mage/Downloadable/Helper/Download.php - - message: "#^Parameter \\#1 \\$str of function strtolower expects string, bool given\\.$#" + message: "#^Parameter \\#1 \\$string of function strtolower expects string, bool given\\.$#" count: 2 path: app/code/core/Mage/Downloadable/Helper/Download.php @@ -4291,7 +4276,7 @@ parameters: path: app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php - - message: "#^Parameter \\#2 \\$str of function explode expects string, array given\\.$#" + message: "#^Parameter \\#2 \\$string of function explode expects string, array given\\.$#" count: 1 path: app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php @@ -4531,7 +4516,7 @@ parameters: path: app/code/core/Mage/Eav/Model/Form.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, false given\\.$#" + message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, false given\\.$#" count: 1 path: app/code/core/Mage/Eav/Model/Form.php @@ -4640,11 +4625,6 @@ parameters: count: 1 path: app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php - - - message: "#^Parameter \\#2 \\$fields of function fputcsv expects array\\, null given\\.$#" - count: 1 - path: app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php - - message: "#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\\:\\:getAllOptions\\(\\) invoked with 1 parameter, 0 required\\.$#" count: 1 @@ -4680,11 +4660,6 @@ parameters: count: 1 path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - - message: "#^Parameter \\#2 \\$length of function fgetcsv expects int\\<0, max\\>, null given\\.$#" - count: 4 - path: app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php - - message: "#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\\:\\:getAllOptions\\(\\) invoked with 1 parameter, 0 required\\.$#" count: 1 @@ -4870,6 +4845,51 @@ parameters: count: 2 path: app/code/core/Mage/Log/Model/Resource/Log.php + - + message: "#^Method Mage_Media_Model_File_Image\\:\\:getImage\\(\\) should return bool\\|resource but returns GdImage\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Method Mage_Media_Model_File_Image\\:\\:getTmpImage\\(\\) should return resource but returns \\(GdImage\\|false\\)\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#1 \\$dst_image of function imagecopyresampled expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#1 \\$image of function imagedestroy expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#1 \\$image of function imagegif expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#1 \\$image of function imagejpeg expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#1 \\$image of function imagepng expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#1 \\$image of function imagewebp expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + + - + message: "#^Parameter \\#2 \\$src_image of function imagecopyresampled expects GdImage, resource given\\.$#" + count: 1 + path: app/code/core/Mage/Media/Model/File/Image.php + - message: "#^Call to function is_null\\(\\) with bool will always evaluate to false\\.$#" count: 1 @@ -5761,7 +5781,7 @@ parameters: path: app/code/core/Mage/Sales/Model/Order/Api.php - - message: "#^Parameter \\#1 \\$str of function trim expects string, float given\\.$#" + message: "#^Parameter \\#1 \\$string of function trim expects string, float given\\.$#" count: 2 path: app/code/core/Mage/Sales/Model/Order/Creditmemo.php @@ -6656,7 +6676,7 @@ parameters: path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Abstract.php - - message: "#^Parameter \\#2 \\$str of function explode expects string, array given\\.$#" + message: "#^Parameter \\#2 \\$string of function explode expects string, array given\\.$#" count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Abstract.php @@ -6700,11 +6720,6 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Parameter \\#1 \\$array_arg of function sort contains unresolvable type\\.$#" - count: 1 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Parameter \\#1 \\$cost of method Mage_Shipping_Model_Carrier_Abstract\\:\\:getMethodPrice\\(\\) expects string, float given\\.$#" count: 1 @@ -6715,14 +6730,9 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Parameter \\#2 \\$value of method SimpleXMLElement\\:\\:addChild\\(\\) expects string\\|null, \\(float\\|false\\) given\\.$#" - count: 8 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Parameter \\#2 \\$value of method SimpleXMLElement\\:\\:addChild\\(\\) expects string\\|null, float given\\.$#" - count: 4 + count: 12 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - @@ -6861,7 +6871,7 @@ parameters: path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php - - message: "#^Parameter \\#2 \\$value of method SimpleXMLElement\\:\\:addChild\\(\\) expects string\\|null, \\(float\\|false\\) given\\.$#" + message: "#^Parameter \\#2 \\$value of method SimpleXMLElement\\:\\:addChild\\(\\) expects string\\|null, float given\\.$#" count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -6886,7 +6896,7 @@ parameters: path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php - - message: "#^Parameter \\#1 \\$code of function curl_strerror expects int, \\(resource\\|false\\) given\\.$#" + message: "#^Parameter \\#1 \\$error_code of function curl_strerror expects int, \\(CurlHandle\\|false\\) given\\.$#" count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php @@ -9391,7 +9401,7 @@ parameters: path: app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, string given\\.$#" + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, string given\\.$#" count: 1 path: app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml @@ -11116,7 +11126,7 @@ parameters: path: app/design/frontend/rwd/default/template/catalog/product/list/toolbar.phtml - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, string given\\.$#" + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, string given\\.$#" count: 1 path: app/design/frontend/rwd/default/template/catalog/product/list/toolbar.phtml @@ -11860,6 +11870,16 @@ parameters: count: 1 path: lib/Mage/DB/Mysqli.php + - + message: "#^Parameter \\#1 \\$handle of function curl_setopt expects CurlHandle, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/HTTP/Client/Curl.php + + - + message: "#^Parameter \\#1 \\$handle of function curl_setopt_array expects CurlHandle, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/HTTP/Client/Curl.php + - message: "#^Property Mage_HTTP_Client_Socket\\:\\:\\$_postFields is never read, only written\\.$#" count: 1 @@ -11875,6 +11895,76 @@ parameters: count: 1 path: lib/Mage/System/Ftp.php + - + message: "#^Parameter \\#1 \\$ftp of function ftp_cdup expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_chdir expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 3 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_chmod expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 2 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_close expects FTP\\\\Connection, resource given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_delete expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_fput expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_get expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_login expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_mkdir expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 2 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_nlist expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_pasv expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_put expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_raw expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + + - + message: "#^Parameter \\#1 \\$ftp of function ftp_rawlist expects FTP\\\\Connection, resource\\|false given\\.$#" + count: 1 + path: lib/Mage/System/Ftp.php + - message: "#^Parameter \\#4 \\$mode of function ftp_fput expects 1\\|2, int given\\.$#" count: 1 @@ -12016,12 +12106,12 @@ parameters: path: lib/Varien/Data/Form/Element/Multiline.php - - message: "#^Parameter \\#1 \\$input of function str_pad expects string, int\\<0, 23\\> given\\.$#" + message: "#^Parameter \\#1 \\$string of function str_pad expects string, int\\<0, 23\\> given\\.$#" count: 1 path: lib/Varien/Data/Form/Element/Time.php - - message: "#^Parameter \\#1 \\$input of function str_pad expects string, int\\<0, 59\\> given\\.$#" + message: "#^Parameter \\#1 \\$string of function str_pad expects string, int\\<0, 59\\> given\\.$#" count: 2 path: lib/Varien/Data/Form/Element/Time.php @@ -12040,6 +12130,11 @@ parameters: count: 1 path: lib/Varien/Data/Tree/Node/Collection.php + - + message: "#^Parameter \\#2 \\$value of method mysqli\\:\\:options\\(\\) expects int\\|string, true given\\.$#" + count: 1 + path: lib/Varien/Db/Adapter/Mysqli.php + - message: "#^Variable \\$result might not be defined\\.$#" count: 1 @@ -12115,28 +12210,13 @@ parameters: count: 1 path: lib/Varien/Filter/Template/Tokenizer/Variable.php - - - message: "#^Method Varien_Http_Adapter_Curl\\:\\:_getResource\\(\\) has invalid return type CurlHandle\\.$#" - count: 1 - path: lib/Varien/Http/Adapter/Curl.php - - message: "#^Parameter \\#3 \\$value of function curl_setopt expects bool, int given\\.$#" count: 2 path: lib/Varien/Http/Adapter/Curl.php - - message: "#^Property Varien_Http_Adapter_Curl\\:\\:\\$_resource has unknown class CurlHandle as its type\\.$#" - count: 1 - path: lib/Varien/Http/Adapter/Curl.php - - - - message: "#^Property Varien_Image_Adapter_Abstract\\:\\:\\$_imageHandler has unknown class GdImage as its type\\.$#" - count: 1 - path: lib/Varien/Image/Adapter/Abstract.php - - - - message: "#^Parameter \\#1 \\$groupname of function posix_getgrnam expects string, int\\|false given\\.$#" + message: "#^Parameter \\#1 \\$name of function posix_getgrnam expects string, int\\|false given\\.$#" count: 1 path: lib/Varien/Io/File.php @@ -12201,6 +12281,6 @@ parameters: path: lib/Varien/Simplexml/Element.php - - message: "#^Parameter \\#2 \\$timestamp of function gmdate expects int, float given\\.$#" + message: "#^Parameter \\#2 \\$timestamp of function gmdate expects int\\|null, float given\\.$#" count: 1 path: shell/indexer.php