Add a PHPStan rule to detect the use of apply_filters and prompt developers to use wpm_apply_filters_typed() instead.
Justification:
Code Quality: Encourages the use of typed filters, improving type safety and reducing potential errors.
Consistency: Promotes a consistent approach to applying filters across the codebase.
This rule will help ensure that all filters in the WP Rocket codebase are applied using the more robust and type-safe wpm_apply_filters_typed() function
Add a PHPStan rule to detect the use of
apply_filters
and prompt developers to usewpm_apply_filters_typed()
instead.Justification: Code Quality: Encourages the use of typed filters, improving type safety and reducing potential errors. Consistency: Promotes a consistent approach to applying filters across the codebase.
Example: The following will prompt an error:
In favor of:
This rule will help ensure that all filters in the WP Rocket codebase are applied using the more robust and type-safe
wpm_apply_filters_typed()
function