Merged
Conversation
Owner
|
Do we need to bump phpstan version? |
Contributor
Author
|
I don't think so. It should be sufficient to ignore these errors. However, we should be considerate about identifier names. If people use the identifiers to ignore errors, they won't be happy if the identifiers change. |
Owner
|
Thank you, Ian. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces rule error identifiers for the following rules:
IsWpErrorRuleHookDocsRuleHookCallbackRuleThe identifiers are sourced from the PHPStan code base, except for
paramTag.count. PHPStan does not have a corresponding error identifier for this; there isarguments.count, but this handles arguments, not tags. If anyone has better ideas on how to name the identifiers, I am happy to change them.For
HookDocsRuleandHookCallbackRule, this PR replaces the try-catch blocks with checks for existing errors in an array holding the errors and removes the exceptions since they are no longer used. Keeping the exceptions would have required different exceptions for each error identifier to retrieve the correct identifier if the exception is thrown.Changes not related to error identifiers:
HookCallbackRule::getAcceptedArgs().HookCallbackRule::validateActionReturnType()andHookCallbackRule::validateFilterReturnType()on the return type instead of on the callable acceptor.HookCallbackRule::isNever()toHookCallbackRule::isExplicitNever()to be more explicit about the method's functionality.