Skip to content
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

improved phpstan.md article #2985

Merged
merged 9 commits into from
Jan 23, 2025
10 changes: 8 additions & 2 deletions docs/dg/dev/sdks/sdk/development-tools/phpstan.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@ composer require --dev phpstan/phpstan
1. Run the following command to generate autocompletion and prevent any error messages that might occur due to the incomplete classes:
`vendor/bin/console dev:ide:generate-auto-completion`
2. Run this command to start analyzing:
`php -d memory_limit=2048M vendor/bin/phpstan analyze -c vendor/spryker/spryker/phpstan.neon vendor/<spryker | spryker-eco | spryker-middleware>/<MODULE>/ -l 2`
`php -d memory_limit=2048M vendor/bin/phpstan analyze -l 6 -c phpstan.neon src/`

{% info_block errorBox %}

Note that running this command with the level 2 key (**-l 2**) and having no errors is obligatory, and having no errors with level 5 (**-l 5**) is highly recommended.
By default, Spryker demo shops are configured with PHPStan at level 6 in the `phpstan.neon` file, which is the highly recommended configuration for Spryker projects.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the level is 6 in phpstan.neon, -l 6 is not needed in the command

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed but I would leave it as an example and make it more obvious


{% endinfo_block %}

## Baseline

[PHPStan baseline](https://phpstan.org/user-guide/baseline)

If you need to raise the level, add new rules or extensions, you can generate a baseline and enable it for future changes.

## Additional functionality

**Main configuration file inheritance**
Expand Down
Loading