Skip to content

Commit

Permalink
NamingConventions/ValidHookName: minor documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Nov 4, 2023
1 parent 395ad68 commit 4385597
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Yoast/Sniffs/NamingConventions/ValidHookNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Check the number of words in hook names and the use of the correct prefix-type,
* but only when plugin specific prefixes have been passed.
*
* {@internal For now allows for an array of both old-style as well as new-style
* {@internal For now, allows for an array of both old-style as well as new-style
* prefixes during the transition period.
* Once all plugins have been transitioned over to use the new-style
* namespace-like prefix for hooks, the `WrongPrefix` warning should be
Expand Down Expand Up @@ -72,7 +72,7 @@ final class ValidHookNameSniff extends WPCS_ValidHookNameSniff {
* Keep track of the content of first text string which was passed to the `transform()`
* method as it may be repeatedly called for the same token.
*
* @var bool
* @var string
*/
private $first_string = '';

Expand All @@ -90,10 +90,11 @@ final class ValidHookNameSniff extends WPCS_ValidHookNameSniff {
/**
* Process the parameters of a matched function.
*
* @param int $stackPtr The position of the current token in the stack.
* @param string $group_name The name of the group which was matched.
* @param string $matched_content The token content (function name) which was matched.
* @param array $parameters Array with information about the parameters.
* @param int $stackPtr The position of the current token in the stack.
* @param string $group_name The name of the group which was matched.
* @param string $matched_content The token content (function name) which was
* matched in lowercase.
* @param array<int, array<string, int|string>> $parameters Array with information about the parameters.
*
* @return void
*/
Expand Down Expand Up @@ -205,8 +206,8 @@ protected function transform( $text_string, $regex, $transform_type = 'full' ) {
/**
* Additional YoastCS specific hook name checks.
*
* @param int $stackPtr The position of the current token in the stack.
* @param array $hook_name_param Array with information about the hook name parameter.
* @param int $stackPtr The position of the current token in the stack.
* @param array<string, int|string> $hook_name_param Array with information about the hook name parameter.
*
* @return void
*/
Expand Down

0 comments on commit 4385597

Please sign in to comment.