Let findHooks.php find UserCreateForm/UserLoginForm
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 5 Nov 2016 09:36:52 +0000 (10:36 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 5 Nov 2016 09:36:52 +0000 (10:36 +0100)
To make findHooks.php happy the hooks must be explicit called with
Hooks::run, passing the name with a variable makes it impossible to
detect and therefore the script unhappy.
In case of B/C this is should be a possible solution.

Change-Id: Iaf4d325a3821e09a742d23a3a5bca8493965bfb8

includes/specialpage/LoginSignupSpecialPage.php

index 984e32b..c4e1f17 100644 (file)
@@ -763,10 +763,18 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                $wgAuth->modifyUITemplate( $template, $action );
 
                $oldTemplate = $template;
-               $hookName = $this->isSignup() ? 'UserCreateForm' : 'UserLoginForm';
-               Hooks::run( $hookName, [ &$template ] );
-               if ( $oldTemplate !== $template ) {
-                       wfDeprecated( "reference in $hookName hook", '1.27' );
+
+               // Both Hooks::run are explicit here to make findHooks.php happy
+               if ( $this->isSignup() ) {
+                       Hooks::run( 'UserCreateForm', [ &$template ] );
+                       if ( $oldTemplate !== $template ) {
+                               wfDeprecated( "reference in UserCreateForm hook", '1.27' );
+                       }
+               } else {
+                       Hooks::run( 'UserLoginForm', [ &$template ] );
+                       if ( $oldTemplate !== $template ) {
+                               wfDeprecated( "reference in UserLoginForm hook", '1.27' );
+                       }
                }
 
                return $template;