Replace use of &$this
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index f0b48d5..a55cbc1 100644 (file)
@@ -255,7 +255,10 @@ class ResourceLoader implements LoggerAwareInterface {
                $this->register( include "$IP/resources/ResourcesOOUI.php" );
                // Register extension modules
                $this->register( $config->get( 'ResourceModules' ) );
-               Hooks::run( 'ResourceLoaderRegisterModules', [ &$this ] );
+
+               // Avoid PHP 7.1 warning from passing $this by reference
+               $rl = $this;
+               Hooks::run( 'ResourceLoaderRegisterModules', [ &$rl ] );
 
                if ( $config->get( 'EnableJavaScriptTest' ) === true ) {
                        $this->registerTestModules();
@@ -404,7 +407,9 @@ class ResourceLoader implements LoggerAwareInterface {
                $testModules = [];
                $testModules['qunit'] = [];
                // Get other test suites (e.g. from extensions)
-               Hooks::run( 'ResourceLoaderTestModules', [ &$testModules, &$this ] );
+               // Avoid PHP 7.1 warning from passing $this by reference
+               $rl = $this;
+               Hooks::run( 'ResourceLoaderTestModules', [ &$testModules, &$rl ] );
 
                // Add the testrunner (which configures QUnit) to the dependencies.
                // Since it must be ready before any of the test suites are executed.