-
Notifications
You must be signed in to change notification settings - Fork 220
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
Closes #7119 #7132
base: develop
Are you sure you want to change the base?
Closes #7119 #7132
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
As we are getting some complexities in the test of this rules, we've decided to seperate the rule and the test in two issues. This is why I'm deleting the beginning of test implementation from this PR, to create a new issue for it. To make it short, the problem that is happening in here is that the custom rules is able to parse docblocks while running for real code. But in the tests, it's detecting the docblock but considering them empty, and we can't explain it at the moment. As we don't want to block any development made, we've decided to proceed with manual test at first, and implement tests in a second step. |
fb69320
to
c29054a
Compare
Did we validate that all possible errors are correctly covered? |
@remyperona as I said in the comment, unit tests are a bit tricky with the docblock. |
If we did manual testing for the possible cases, sounds good. |
Description
Fixes #7119
Nothing impacts users.
Type of change
Detailed scenario
n/a
Technical description
Documentation
This pull request introduces several changes to enhance PHPStan integration and adds a new custom rule for validating
@param
tags in docblocks. The most important changes include adding a new script to reset the PHPStan baseline, updating the PHPStan configuration files, and implementing a custom PHPStan rule.Enhancements to PHPStan integration:
composer.json
: Added a new scriptrun-stan-reset-baseline
to reset the PHPStan baseline.phpstan-baseline.neon
: Added baseline configurations to ignore specific errors in certain files.phpstan.neon.dist
: Updated theparameters
section to include a new directory and added the custom ruleWP_Rocket\Tests\phpstan\Rules\ApplyFiltersTypedDynamicFunctionReturnTypeExtension
. [1] [2]Implementation of a custom PHPStan rule:
tests/phpstan/Rules/ApplyFiltersTypedDynamicFunctionReturnTypeExtension.php
: Added a new custom rule to validate@param
tags in docblocks for thewpm_apply_filters_typed
function.Mandatory Checklist
Code validation
Code style