From aeb1a0f951037558f71fea7e307cb365afb76e03 Mon Sep 17 00:00:00 2001 From: Jakub Hejtmanek Date: Thu, 18 Mar 2021 10:09:31 +0100 Subject: [PATCH] phpstan magento ateli compatibility --- README.md | 8 +++----- composer.json | 6 +++--- extension.neon | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3046c52..30ab781 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Extension for [PHPStan](https://github.com/phpstan/phpstan) to allow analysis of Magento 1 code. -Currently it assumes Magento is installed in the `htdocs/` directory of the project root. Further work is needed in phpstan itself to allow more intellegence for extensions to be more customised whilst working with both phpstan/phpstan and phpstan/phpstan-shim. - ## Usage Add `phpstan.neon` to your Magento 1 project. @@ -12,18 +10,18 @@ Make sure it has ```neon includes: - - vendor/vianetz/phpstan-magento1/extension.neon + - vendor/ateli-development/phpstan-magento1/extension.neon ``` Then run ```bash -composer require inviqa/phpstan-magento1 phpstan/phpstan +composer require inviqa/phpstan-magento1:dev-ateli_compatibility phpstan/phpstan ``` ## Alternative Magento path -By default this extension assumes the Magento directory is `%currentWorkingDirectory%/htdocs`. +By default this extension assumes the Magento directory is `%currentWorkingDirectory%`. Add to the project's phpstan.neon: diff --git a/composer.json b/composer.json index 283fc96..585d189 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { - "name": "vianetz/phpstan-magento1", + "name": "ateli-development/phpstan-magento1", "description": "Extension for PHPStan to allow analysis of Magento 1 code.", "type": "library", "require": { - "phpstan/phpstan": "^0.11|^0.12", + "phpstan/phpstan": "^0.12", "php": ">= 7.2" }, "replace": { - "inviqa/phpstan-magento1": "0.1.5" + "vianetz/phpstan-magento1": "dev-compatibility_with_phpstan_v0.12" }, "autoload": { "psr-4": { diff --git a/extension.neon b/extension.neon index 54374de..d43ff6e 100644 --- a/extension.neon +++ b/extension.neon @@ -3,7 +3,7 @@ parameters: - */app/code/local/*/*/data/* - */app/code/local/*/*/sql/* bootstrapFiles: - - %currentWorkingDirectory%/htdocs/app/Mage.php + - %currentWorkingDirectory%/app/Mage.php - phpstan-bootstrap.php typeAliases: Mage_Catalog_Model_Entity_Product_Collection: 'Mage_Catalog_Model_Resource_Product_Collection'