Skip to content

Hooks/Docs: twentyeleven and twentytwentyone hooks have malformed @param tags — variable name missing #18

Closed as not planned

Description

@apermo

Problem

PHPStan reports three filters as having 0 @param tags even though @param lines exist in the PHPDoc blocks. The cause is that all three use the format @param type Description — omitting the required $variable_name. PHPStan's PHPDoc parser does not recognize these as valid @param tags.

Affected hooks

twentyeleven_author_bio_avatar_size — wp-content/themes/twentyeleven/author.php:

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-content/themes/twentyeleven/author.php#L55-L62

Current (malformed):

 * @param int The height and width avatar dimension in pixels. Default 60.

twentyeleven_attachment_size — wp-content/themes/twentyeleven/image.php:

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-content/themes/twentyeleven/image.php#L98-L104

Current (malformed):

 * @param int The width for the image attachment size in pixels. Default 848.

twentytwentyone_html_classes — wp-content/themes/twentytwentyone/functions.php:

https://github.com/apermo/wordpress-develop/blob/trunk/src/wp-content/themes/twentytwentyone/functions.php#L576-L582

Current (malformed):

 * @param string The list of classes. Default empty string.

Fix

Add the missing $variable_name to each @param tag:

- * @param int The height and width avatar dimension in pixels. Default 60.
+ * @param int $size The height and width avatar dimension in pixels. Default 60.
- * @param int The width for the image attachment size in pixels. Default 848.
+ * @param int $width The width for the image attachment size in pixels. Default 848.
- * @param string The list of classes. Default empty string.
+ * @param string $classes The list of classes. Default empty string.

Activity

  1. apermo commented on Mar 8, 2026

    @apermo
    OwnerAuthor

    is in themes, out of scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions