Open
Description
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:
/**
* Filter the rocket cache options.
*
* @param array $options Cache options.
* @return array Filtered cache options.
*/
$options = wpm_apply_filters_typed( 'array', 'rocket_cache_options', $options );