10up / safe-redirect-manager

A simple HTTP redirection plugin for WordPress.
https://wordpress.org/plugins/safe-redirect-manager
GNU General Public License v2.0
314 stars 82 forks source link

Hook docblocks #398

Closed szepeviktor closed 1 month ago

szepeviktor commented 1 month ago

Describe the bug

Hook docblocks are not standard (compared to WordPress core, PHPStan)

https://github.com/10up/safe-redirect-manager/blob/fb74c570c1d33c1b60bdef327c90100414c8daee/inc/functions.php#L112-L119

Steps to Reproduce

Would you merge a PR fixing all those?

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

dkotter commented 1 month ago
  • There is no need to declare the hook name in the docblock
  • The first @param is the third parameter of apply_filters, the first one is the hook name, the second one is the initial value
  • Current docblock is a JSDoc block, not PHPDoc

All of these are expected as we use the wp-hookdoc tool to automatically create a documentation site (see https://10up.github.io/safe-redirect-manager/).

wp-hookdoc utilizes JSDoc to process these comments, which is why these docblocks are different from what we use on functions or methods.

We are exploring a new tool to automate this documentation but there's no timeline on when that will happen, so going to close this out.

szepeviktor commented 1 month ago

I see. That project is abandoned 6 years ago.