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
Increase PHPStan level to 1 #4584
Conversation
@@ -51,7 +51,7 @@ jobs: | |||
| grep -v tests/TestCase.php \ | |||
&& (echo "UNKNOWN FILES DETECTED" && travis_terminate 1) || echo "NO UNKNOWN FILES" | |||
- ./check_trailing_spaces.sh || travis_terminate 1 | |||
- ./dev-tools/tools/phpstan analyse | |||
- php -d auto_prepend_file=dev-tools/vendor/autoload.php ./dev-tools/tools/phpstan analyse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prepeding the dev-tools/vendor/autoload.php
is required so that the PHPStan Phar file is able to load phpstan/phpstan-phpunit
extension but this feels very hacky and I can't say there is no downside. Any better idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use a dedicated composer.json
for PHPStan in a nested dir in dev-tools
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps specify using https://github.com/phpstan/phpstan#specify-paths-to-scan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpacePossum Do you mean install PHPStan itself using Composer instead of Phive? Otherwise it won't fix the issue I think.
@localheinz I just tried and I doesn't work. As far as I can tell, these options are for parts of the scanned codebase that isn't autoloaded by Composer, not for extensions to PHPStan runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, given the issues we have with Phive lately I wouldn't mind switch (back) to composer installs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we switch back to composer installs I'd vote to move all dev dependencies to dev-tools/composer.json
and merge it to the main composer.json
from there.
@@ -1,5 +1,8 @@ | |||
includes: | |||
- dev-tools/vendor/phpstan/phpstan-phpunit/extension.neon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This extension helps PHPStan understand how PHPUnit works. Specifically it helps it know that static::markTestSkipped()
ends the test execution.
Thank you @julienfalque. |
This PR was merged into the 2.15 branch. Discussion ---------- Increase PHPStan level to 1 Commits ------- c5f71b7 Increase PHPStan level to 1
No description provided.