X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=maintenance%2FfindHooks.php;h=f9c61c70f734c4d0e18f53a7eb6773bf649fa93e;hb=7bd97758f7e1496c7d4a1fa4e7275c9d6c01c5c3;hp=4afeb0e87284ff9634ccdf8451276a389673b958;hpb=01eb216c5f3640ae020df362ff62dd91ae61be3c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index 4afeb0e872..f9c61c70f7 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -128,8 +128,8 @@ class FindHooks extends Maintenance { $todo = array_diff( $potential, $documented, self::$ignore ); $deprecated = array_diff( $documented, $potential, self::$ignore ); - // Check parameter count - $badParameter = array(); + // Check parameter count and references + $badParameterCount = $badParameterReference = array(); foreach ( $potentialHooks as $hook => $args ) { if ( !isset( $documentedHooks[$hook] ) ) { // Not documented, but that will also be in $todo @@ -141,7 +141,16 @@ class FindHooks extends Maintenance { continue; } if ( count( $argsDoc ) !== count( $args ) ) { - $badParameter[] = $hook . ': Doc: ' . count( $argsDoc ) . ' vs. Code: ' . count( $args ); + $badParameterCount[] = $hook . ': Doc: ' . count( $argsDoc ) . ' vs. Code: ' . count( $args ); + } else { + // Check if & is equal + foreach ( $argsDoc as $index => $argDoc ) { + $arg = $args[$index]; + if ( ( $arg[0] === '&' ) !== ( $argDoc[0] === '&' ) ) { + $badParameterReference[] = $hook . ': References different: Doc: ' . $argDoc . + ' vs. Code: ' . $arg; + } + } } } @@ -149,10 +158,11 @@ class FindHooks extends Maintenance { $this->printArray( 'Undocumented', $todo ); $this->printArray( 'Documented and not found', $deprecated ); $this->printArray( 'Unclear hook calls', $bad ); - $this->printArray( 'Different parameter count', $badParameter ); + $this->printArray( 'Different parameter count', $badParameterCount ); + $this->printArray( 'Different parameter reference', $badParameterReference ); if ( count( $todo ) == 0 && count( $deprecated ) == 0 && count( $bad ) == 0 - && count( $badParameter ) == 0 + && count( $badParameterCount ) == 0 && count( $badParameterReference ) == 0 ) { $this->output( "Looks good!\n" ); } else {