X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfindHooks.php;h=fd36db1dd2bc0bbefb1fc57b1bb01eb380ae8154;hb=dfafef8e706af54706d2de621b845085604f154d;hp=81e18c993b08d677ee9146c2124a18f1e571cd5f;hpb=bdfa96eb726c9997a010f5a194eec71925bfddc2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index 81e18c993b..fd36db1dd2 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -79,6 +79,9 @@ class FindHooks extends Maintenance { $nonRecurseDirs = [ "$IP/", ]; + $extraFiles = [ + "$IP/tests/phpunit/MediaWikiTestCase.php", + ]; foreach ( $recurseDirs as $dir ) { $ret = $this->getHooksFromDir( $dir, self::FIND_RECURSIVE ); @@ -90,6 +93,10 @@ class FindHooks extends Maintenance { $potentialHooks = array_merge( $potentialHooks, $ret['good'] ); $badHooks = array_merge( $badHooks, $ret['bad'] ); } + foreach ( $extraFiles as $file ) { + $potentialHooks = array_merge( $potentialHooks, $this->getHooksFromFile( $file ) ); + $badHooks = array_merge( $badHooks, $this->getBadHooksFromFile( $file ) ); + } $documented = array_keys( $documentedHooks ); $potential = array_keys( $potentialHooks ); @@ -262,6 +269,8 @@ class FindHooks extends Maintenance { $n = []; if ( preg_match_all( '/((?:[^,\(\)]|\([^\(\)]*\))+)/', $match[4], $n ) ) { $args = array_map( 'trim', $n[1] ); + // remove empty entries from trailing spaces + $args = array_filter( $args ); } } elseif ( isset( $match[3] ) ) { // Found a parameter for Hooks::run,