-
Notifications
You must be signed in to change notification settings - Fork 226
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
PHPStan - Ensure Docblock presence for wpm_apply_filters_typed() #7119
Comments
Can I take over this @remyperona ? I can see the draft PR you created |
⚠ @Khadreal |
@Miraeld Can you update this issue to Blocked with a reference to the blocking issue (you mentioned a dedicated PR for tests?) Thanks 🙏 |
Yes I was writing it, To make it short and give some context. This new rule is checking the docblocks prior a From what I'm seeing, the rules works, however, while adding unit tests, it doesn't take into account docblocks, it's ignoring them and says it doesn't detects docblocks. I've created a sub-issue #7150 to tackle these tests. I've also created a PR for it, which could be use as a base. I cannot find a solution for it, and was waiting on @CrochetFeve0251 but he has been busy lately. |
Add a PHPStan rule to ensure a docblock is present before the usage of
wpm_apply_filters_typed()
. The rule should also verify that the types declared in the docblock match the types of parameters passed to the filter.Justification:
Code Quality: Ensures that all usages of
wpm_apply_filters_typed()
are well-documented, improving code readability and maintainability.Type Safety: Verifies that the declared types in the docblock align with the actual parameters, reducing the risk of type-related errors.
Making sure that the following example is the template followed:
The text was updated successfully, but these errors were encountered: