-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
feat: add rule for missing 'provides' method in Deferrable ServiceProviders #1262
feat: add rule for missing 'provides' method in Deferrable ServiceProviders #1262
Conversation
The rule name is also in |
@szepeviktor I renamed the test case to confirm this is a test execution order issue. That seems to indeed be the case.. |
tests/Rules/CheckDispatchArgumentTypesCompatibleWithClassConstructorRuleTest.php
Outdated
Show resolved
Hide resolved
It seems to be green :) |
What change in |
None, I added the beStrictAboutChangesToGlobalState setting to try to debug what was going on, but the issue ended up being in the way the container is booted and subsequently cached in the PHPStan RuleTestCase. All extensions need to be loaded or the next time the container is used it is missing dependencies. That's why I added the AbstractRuleTestCase. |
@szepeviktor @canvural @nunomaduro I'm cleaning up my forks, can I assume this is not going to get merged and close this PR? |
@PrinsFrank Please do not delete your fork. We will take a look at it and merge it. |
@szepeviktor Ok, np! |
… the container is cached too agressively
Thank you! I made some changes to simplify it little bit. |
Changes
This rule will check for a missing 'provides' method in deferrable ServiceProviders.
The 'provides' method is present in the DeferrableProvider interface, but also in the abstract ServiceProvider. If it was not present in the abstract class, this check would not be necessary, but that PR got rejected in Laravel.
Breaking changes