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

Increase PHPStan level to 1 #4584

Merged
merged 1 commit into from Nov 2, 2019
Merged

Conversation

julienfalque
Copy link
Member

No description provided.

@@ -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
Copy link
Member Author

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?

Copy link
Contributor

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 ?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Member Author

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.

@keradus keradus added the RTM Ready To Merge label Nov 2, 2019
@keradus keradus modified the milestones: 2.15.4, 2.15.5 Nov 2, 2019
@keradus
Copy link
Member

keradus commented Nov 2, 2019

Thank you @julienfalque.

keradus added a commit that referenced this pull request Nov 2, 2019
This PR was merged into the 2.15 branch.

Discussion
----------

Increase PHPStan level to 1

Commits
-------

c5f71b7 Increase PHPStan level to 1
@keradus keradus merged commit c5f71b7 into PHP-CS-Fixer:2.15 Nov 2, 2019
@julienfalque julienfalque deleted the phpstan branch November 2, 2019 18:30
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.

None yet

6 participants