diff --git a/.ddev/commands/web/magerun b/.ddev/commands/web/magerun old mode 100644 new mode 100755 index 5ddff79db21a..a03899bf01fc --- a/.ddev/commands/web/magerun +++ b/.ddev/commands/web/magerun @@ -5,7 +5,7 @@ ## Example: "ddev magerun" if [ ! -f vendor/bin/n98-magerun ]; then - read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGE + read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGERUN INSTALL_MAGERUN=${INSTALL_MAGERUN,,} # to lower if [[ "${INSTALL_MAGERUN}" =~ ^(yes|y) ]]; then composer require --dev n98/magerun:dev-develop diff --git a/.ddev/commands/web/openmage-admin b/.ddev/commands/web/openmage-admin old mode 100644 new mode 100755 diff --git a/.github/labeler.yml b/.github/labeler.yml index 61d73ee8dbac..a1b1d9fad162 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -887,6 +887,7 @@ 'phpstan': - changed-files: - any-glob-to-any-file: [ + .phpstan*, phpstan*, .github/workflows/phpstan.yml ] diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 473bd972f402..aa4625cc418e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,15 +13,8 @@ name: "CodeQL" on: workflow_call: + # Allow manually triggering the workflow. workflow_dispatch: - push: - branches: [ "main", "next", "v19" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main", "next", "v19" ] - paths-ignore: - - '**/*.md' - - '**/*.txt' jobs: analyze: diff --git a/.gitignore b/.gitignore index b4818b734030..e5aaad872a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -70,8 +70,11 @@ .phpcs*.xml !.phpcs*.xml.dist +# PhpStan +.phpstan*.neon phpstan*.neon -!phpstan.dist.*.neon +!.phpstan.dist.neon +!.phpstan.dist.*.neon # dev scripts loaded via composer /shell/update-copyright.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 8c1bf39a95b4..562995289288 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -20,6 +20,8 @@ 'class_definition' => true, // Remove extra spaces in a nullable typehint. 'compact_nullable_typehint' => true, + // Concatenation should be spaced according to configuration. + 'concat_space' => ['spacing' => 'one'], // The PHP constants `true`, `false`, and `null` MUST be written using the correct casing. 'constant_case' => true, // Equal sign in declare statement should be surrounded by spaces or not following configuration. diff --git a/phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon similarity index 99% rename from phpstan.dist.baseline.neon rename to .phpstan.dist.baseline.neon index b417687de7de..d70de2060532 100644 --- a/phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -3965,6 +3965,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 diff --git a/phpstan.dist.neon b/.phpstan.dist.neon similarity index 98% rename from phpstan.dist.neon rename to .phpstan.dist.neon index c95f0f645946..a3a1dc335cb1 100644 --- a/phpstan.dist.neon +++ b/.phpstan.dist.neon @@ -1,6 +1,6 @@ includes: - vendor/macopedia/phpstan-magento1/extension.neon - - phpstan.dist.baseline.neon + - .phpstan.dist.baseline.neon - phar://phpstan.phar/conf/bleedingEdge.neon parameters: magentoRootPath: %currentWorkingDirectory% diff --git a/app/Mage.php b/app/Mage.php index e52278f171b0..29a0ce52bcb5 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -433,7 +433,7 @@ public static function getStoreConfigAsInt(string $path, $store = null): int * Retrieve config flag for store by path * * @param string $path - * @param mixed $store + * @param null|string|bool|int|Mage_Core_Model_Store $store * @return bool */ public static function getStoreConfigFlag($path, $store = null) diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php index 9255504e2f35..218ef0eb592b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php @@ -76,7 +76,7 @@ protected function _prepareForm() $fieldset->addField('req_text', 'note', [ 'text' => '
' ]); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index b7296fb11621..b0846a73b7c7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php @@ -78,7 +78,7 @@ public function initForm() $form->getElement('website_id')->setAfterElementHtml( '