CodeMirrorHooks: Objects are passed by default as references

Documentation here: [[mw:Manual:Hooks/BeforePageDisplay]] also
says so about objects passed by defaults as references, no need
for the &.

Also, fixed onResourceLoaderTestModules() function header for the
$rl parameter, removed the & symbol and updated this hook's docs
here: [[mw:Manual:Hooks/ResourceLoaderTestModules]].

Change-Id: Ifdabc47a1a4f02aec4906edb800d360ca4febd76
This commit is contained in:
Derick Alangi 2019-04-04 00:38:24 +01:00
parent 3359cbde31
commit 5579001506

View file

@ -25,10 +25,10 @@ class CodeMirrorHooks {
*
* @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
*
* @param OutputPage &$out
* @param Skin &$skin
* @param OutputPage $out
* @param Skin $skin
*/
public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) {
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
if ( self::isCodeMirrorOnPage( $out ) ) {
$out->addModules( 'ext.CodeMirror' );
@ -60,10 +60,10 @@ class CodeMirrorHooks {
/**
* Register test modules for CodeMirror.
* @param array &$modules
* @param ResourceLoader &$rl
* @param ResourceLoader $rl
* @return bool
*/
public static function onResourceLoaderTestModules( array &$modules, ResourceLoader &$rl ) {
public static function onResourceLoaderTestModules( array &$modules, ResourceLoader $rl ) {
$modules['qunit']['ext.CodeMirror.test'] = [
'scripts' => [
'resources/mode/mediawiki/tests/qunit/CodeMirror.mediawiki.test.js',