From b783ee8db0e89bc663976c40dd8f582dbe774624 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:08:13 +0000 Subject: [PATCH 1/3] Bump phpstan/phpstan from 1.12.3 to 1.12.6 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.12.3 to 1.12.6. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/2.0.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.12.3...1.12.6) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 43940bf95cb..b6aeab5c96f 100644 --- a/composer.lock +++ b/composer.lock @@ -3901,16 +3901,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.3", + "version": "1.12.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009" + "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0fcbf194ab63d8159bb70d9aa3e1350051632009", - "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae", + "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae", "shasum": "" }, "require": { @@ -3955,7 +3955,7 @@ "type": "github" } ], - "time": "2024-09-09T08:10:35+00:00" + "time": "2024-10-06T15:03:59+00:00" }, { "name": "phpunit/php-code-coverage", From e95477b3f6fe3b4538e16e672ed13967dbeee4f0 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Wed, 9 Oct 2024 09:38:27 +0200 Subject: [PATCH 2/3] phpstan 1.12.5 fixes (#4260) * phpstan-fixes * baseline * phpcbf --- .phpstan.dist.baseline.neon | 17 +---------------- .../Catalog/Model/Product/Option/Type/File.php | 2 +- .../Shipping/Carrier/Dhl/International.php | 2 +- lib/Varien/Db/Adapter/Pdo/Mysql.php | 2 +- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon index ac4747f7801..6e4a8afd46c 100644 --- a/.phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -927,7 +927,7 @@ parameters: - message: "#^Offset 'option_id' does not exist on array\\{final_price\\: mixed\\}\\.$#" - count: 4 + count: 2 path: app/code/core/Mage/Bundle/Model/Product/Price.php - @@ -3820,11 +3820,6 @@ 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 @@ -4485,11 +4480,6 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Invalid array key type strin\\.$#" - count: 3 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:_mapRequestToShipment\\(\\) should return null but return statement is missing\\.$#" count: 1 @@ -4505,11 +4495,6 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Parameter \\$type of method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:getCode\\(\\) has invalid type strin\\.$#" - count: 1 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Property Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:\\$_request \\(Mage_Shipping_Model_Rate_Request\\|null\\) does not accept Varien_Object\\.$#" count: 1 diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php index fc551983d47..f093f091a8f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php @@ -749,7 +749,7 @@ protected function _getOptionDownloadUrl($route, $params) protected function _parseExtensionsString($extensions) { preg_match_all('/[a-z0-9]+/si', strtolower($extensions), $matches); - if (isset($matches[0]) && is_array($matches[0]) && count($matches[0]) > 0) { + if (count($matches[0]) > 0) { return $matches[0]; } return null; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index 8f67cd2030a..090c3731615 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -398,7 +398,7 @@ public function getAllowedMethods() /** * Get configuration data of carrier * - * @param strin $type + * @param string $type * @param string $code * @return array|bool */ diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 0f331786a5c..de5a6f10f6d 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -1173,7 +1173,7 @@ public function getForeignKeys($tableName, $schemaName = null) . '( ON DELETE (RESTRICT|CASCADE|SET NULL|NO ACTION))?' . '( ON UPDATE (RESTRICT|CASCADE|SET NULL|NO ACTION))?#'; $matches = []; - preg_match_all($regExp, $createSql, $matches, PREG_SET_ORDER); + preg_match_all($regExp, $createSql, $matches, PREG_SET_ORDER | PREG_UNMATCHED_AS_NULL); foreach ($matches as $match) { $ddl[strtoupper($match[1])] = [ 'FK_NAME' => $match[1], From e3f1e3c8a62580bc6aada36b249c82b8297c18e8 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 13 Oct 2024 04:12:21 +0200 Subject: [PATCH 3/3] Updated .phpstan.dist.baseline.neon --- .phpstan.dist.baseline.neon | 47 +------------------------------------ 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon index cfd5c11fa95..8dbbdf430f1 100644 --- a/.phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -1812,7 +1812,7 @@ parameters: - message: "#^Offset 'option_id' does not exist on array\\{final_price\\: mixed\\}\\.$#" - count: 4 + count: 2 path: app/code/core/Mage/Bundle/Model/Product/Price.php - @@ -3180,16 +3180,6 @@ parameters: count: 15 path: app/code/core/Mage/Catalog/Model/Resource/Setup.php - - - message: "#^Parameter \\#1 \\$categoryIds of method Mage_Catalog_Model_Resource_Url\\:\\:_getCategories\\(\\) expects array\\|int, null given\\.$#" - count: 1 - path: app/code/core/Mage/Catalog/Model/Resource/Url.php - - - - message: "#^Parameter \\#1 \\$productIds of method Mage_Catalog_Model_Resource_Url\\:\\:_getProducts\\(\\) expects array\\|int, null given\\.$#" - count: 1 - path: app/code/core/Mage/Catalog/Model/Resource/Url.php - - message: "#^Parameter \\#3 \\$storeId of method Mage_Catalog_Model_Resource_Url\\:\\:_getProductAttribute\\(\\) expects string, int given\\.$#" count: 1 @@ -6815,11 +6805,6 @@ parameters: count: 1 path: app/code/core/Mage/Sales/Model/Entity/Quote/Payment.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 @@ -7825,11 +7810,6 @@ parameters: count: 1 path: app/code/core/Mage/Uploader/Model/Config/Abstract.php - - - message: "#^Parameter \\#1 \\$type of method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:getCode\\(\\) expects strin, string given\\.$#" - count: 5 - path: app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php - - message: "#^Parameter \\#2 \\$type of class Zend_Measure_Length constructor expects int\\|null, string given\\.$#" count: 1 @@ -7950,11 +7930,6 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Invalid array key type strin\\.$#" - count: 3 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:_mapRequestToShipment\\(\\) should return null but return statement is missing\\.$#" count: 1 @@ -7980,11 +7955,6 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Parameter \\#1 \\$type of method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:getCode\\(\\) expects strin, string given\\.$#" - count: 6 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Parameter \\#2 \\$value of method SimpleXMLElement\\:\\:addChild\\(\\) expects string\\|null, \\(array\\|float\\|int\\) given\\.$#" count: 1 @@ -8025,11 +7995,6 @@ parameters: count: 1 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Parameter \\$type of method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:getCode\\(\\) has invalid type strin\\.$#" - count: 1 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - message: "#^Property Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:\\$_request \\(Mage_Shipping_Model_Rate_Request\\|null\\) does not accept Varien_Object\\.$#" count: 1 @@ -8050,16 +8015,6 @@ parameters: count: 2 path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php - - - message: "#^Parameter \\#1 \\$type of method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:getCode\\(\\) expects strin, string given\\.$#" - count: 1 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php - - - - message: "#^Parameter \\#1 \\$type of method Mage_Usa_Model_Shipping_Carrier_Dhl_International\\:\\:getCode\\(\\) expects strin, string given\\.$#" - count: 1 - path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php - - message: "#^Method Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page\\:\\:drawText\\(\\) should return \\$this\\(Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page\\) but returns Zend_Pdf_Canvas_Interface\\.$#" count: 1