jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/375804 )
Change subject: Don't pass $this by reference
......................................................................
Don't pass $this by reference
Change-Id: I2fad4326bc0e96441cd90ade4a0f9a2ced551b8b
---
M MetrolookTemplate.php
M SkinMetrolookHooks.php
M phpcs.xml
3 files changed, 15 insertions(+), 15 deletions(-)
Approvals:
Paladox: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MetrolookTemplate.php b/MetrolookTemplate.php
index a44710d..82c0cda 100644
--- a/MetrolookTemplate.php
+++ b/MetrolookTemplate.php
@@ -518,7 +518,8 @@
<div id="mw-panel-right" class="noprint">
<?php
// Hook point for the ShoutWiki Ads extension
- Hooks::run( 'MetrolookRightPanel', [ $this ] );
+ $skin = $this;
+ Hooks::run( 'MetrolookRightPanel', [ &$skin ] );
?>
</div>
@@ -559,7 +560,8 @@
case 'TOOLBOX':
$this->renderPortal( 'tb',
$this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd' );
// Hook point for the ShoutWiki Ads
extension
- Hooks::run( 'MetrolookAfterToolbox', [
$this ] );
+ $skin = $this;
+ Hooks::run( 'MetrolookAfterToolbox', [
&$skin ] );
break;
case 'LANGUAGES':
if ( $this->data['language_urls'] !==
false ) {
@@ -604,7 +606,8 @@
echo
$this->makeListItem( $key, $val );
}
if ( $hook !== null ) {
- Hooks::run( $hook, [
&$this, true ] );
+ $skin = $this;
+ Hooks::run( $hook, [
&$skin, true ] );
}
?>
</ul>
diff --git a/SkinMetrolookHooks.php b/SkinMetrolookHooks.php
index 0f8a57d..dc12137 100644
--- a/SkinMetrolookHooks.php
+++ b/SkinMetrolookHooks.php
@@ -35,7 +35,7 @@
* This method is public to allow other extensions that use
CollapsibleVector to use the
* same configuration as CollapsibleVector itself
*
- * @param $name string Name of the feature, should be a key of $features
+ * @param $name string Name of the feature, should be a key of $name
* @return bool
*/
public static function isEnabled( $name ) {
@@ -70,8 +70,8 @@
*
* Adds the modules to the page
*
- * @param $out OutputPage output page
- * @param $skin Skin current skin
+ * @param OutputPage $out
+ * @param Skin $skin
*/
public static function beforePageDisplay( $out, $skin ) {
if ( $skin instanceof SkinMetrolook ) {
@@ -90,8 +90,8 @@
*
* Adds Vector-releated items to the preferences
*
- * @param $user User current user
- * @param $defaultPreferences array list of default user preference
controls
+ * @param User current user $user
+ * @param array list of default user preference controls
&$defaultPreferences
*/
public static function getPreferences( $user, &$defaultPreferences ) {
global $wgMetrolookFeatures;
@@ -140,7 +140,7 @@
}
/**
- * @param $vars array
+ * @param array &$vars
* @return bool
*/
public static function makeGlobalVariablesScript( &$vars ) {
diff --git a/phpcs.xml b/phpcs.xml
index 266ecb6..a143456 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,13 +1,10 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
- <exclude
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
+ <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
+ <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
+ <exclude
name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamTag"/>
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamComment"/>
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamName"/>
- <exclude
name="MediaWiki.Commenting.FunctionComment.MissingReturn"/>
- <exclude name="MediaWiki.Usage.ReferenceThis.Found"/>
</rule>
<file>.</file>
<arg name="extensions" value="php,php5,inc"/>
--
To view, visit https://gerrit.wikimedia.org/r/375804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2fad4326bc0e96441cd90ade4a0f9a2ced551b8b
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits