Skip to content

PHPStan - Ensure Docblock presence for wpm_apply_filters_typed() #7119

Open
0 of 1 issue completed
Open
@Miraeld

Description

@Miraeld

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 );

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev initiativetype: enhancementImprovements that slightly enhance existing functionality and are fast to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions