Skip to content

phpstan magento ateli compatibility #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down