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

Linting tools: add PHPStan #26

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Linting tools: add PHPStan #26

wants to merge 6 commits into from

Conversation

jeherve
Copy link
Owner

@jeherve jeherve commented Nov 26, 2021

Changes proposed in this Pull Request:

- Linting: add PHPStan tools to analyze the codebase

  • Avoid issues with custom apply_filters
  • Fix level 4 issues
  • Add PHPStan to linting action

A few notes:

  • When trying to use PHPStan's options to ignore specific lines, I kept getting memory fatal errors. So I had to make those ignore rules in the config file instead.
  • When trying to up the config to level 5, I keep running into the same memory Fatals locally. I may try it in the CI though.

Edit: I see I get the same fatals in the CI already, even at level 4:

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in phar:///home/runner/work/posts-on-this-day/posts-on-this-day/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/Lexer.php on line 263
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in phar:///home/runner/work/posts-on-this-day/posts-on-this-day/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/Lexer.php on line 263
Script ./vendor/bin/phpstan analyze -c phpstan.neon.dist --memory-limit 128M handling the phpstan event returned with error code 255

Testing instructions:

  • Do the tests pass?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant