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 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/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", 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],