Re-enable MediaWiki.VariableAnalysis.UnusedGlobalVariables
authorReedy <reedy@wikimedia.org>
Sat, 26 Sep 2015 14:51:52 +0000 (15:51 +0100)
committerReedy <reedy@wikimedia.org>
Sat, 26 Sep 2015 14:51:52 +0000 (15:51 +0100)
Globals are used in included file, so ignore warning in this case

Change-Id: I50315425827cc49eac3ca943a5a8952d0292ce23

includes/installer/Installer.php
phpcs.xml

index 72e11db..d98ca79 100644 (file)
@@ -538,9 +538,11 @@ abstract class Installer {
                global $wgAutoloadClasses;
                $wgAutoloadClasses = array();
 
+               // @codingStandardsIgnoreStart
                // LocalSettings.php should not call functions, except wfLoadSkin/wfLoadExtensions
                // Define the required globals here, to ensure, the functions can do it work correctly.
                global $wgExtensionDirectory, $wgStyleDirectory;
+               // @codingStandardsIgnoreEnd
 
                MediaWiki\suppressWarnings();
                $_lsExists = file_exists( "$IP/LocalSettings.php" );
index f34b274..f5156b3 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -9,7 +9,6 @@
                <exclude name="MediaWiki.WhiteSpace.SpaceyParenthesis.SingleSpaceAfterOpenParenthesis"/>
                <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
                <exclude name="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed"/>
-               <exclude name="MediaWiki.VariableAnalysis.UnusedGlobalVariables"/>
                <exclude name="MediaWiki.WhiteSpace.SpaceAfterControlStructure.Incorrect"/>
                <exclude name="PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter"/>
                <exclude name="PSR2.Methods.MethodDeclaration.AbstractAfterVisibility"/>