Add ignoreList for valid global variable name sniff in phpcs.xml
authorVivek Ghaisas <v.a.ghaisas@gmail.com>
Thu, 10 Sep 2015 05:29:32 +0000 (10:59 +0530)
committerVivek Ghaisas <v.a.ghaisas@gmail.com>
Sat, 26 Sep 2015 21:49:46 +0000 (03:19 +0530)
The list of variables to ignore was hardcoded in the sniff. Moving it to
the phpcs.xml file allows setting it on a per-project basis, and hence,
should be set in core's phpcs.xml.

Bug: T104501
Change-Id: I6909b1d3845ba72d867fe01e86bd4a8f6bef198f

phpcs.xml

index 9410d89..f76e0e4 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
                        <property name="ignoreList" type="array" value="bfNormalizeTitleStrReplace,bfNormalizeTitleStrTr,cdbShowHelp,codepointToUtf8,compare_point,cssfilter,escapeSingleString,findAuxFile,findFiles,getEscapedProfileUrl,getFileCommentFromSourceWiki,getFileUserFromSourceWiki,hexSequenceToUtf8,mccGetHelp,mccShowUsage,mimeTypeMatch,moveToExternal,NothingFunction,NothingFunctionData,resolveStub,resolveStubs,showUsage,splitFilename,utf8ToCodepoint,utf8ToHexSequence" />
                </properties>
        </rule>
+       <rule ref="MediaWiki.NamingConventions.ValidGlobalName">
+               <properties>
+                       <property name="ignoreList" type="array" value="$IP,$messageMemc,$parserMemc" />
+               </properties>
+       </rule>
        <file>.</file>
        <arg name="encoding" value="utf8"/>
        <arg name="extensions" value="php,php5,inc,sample"/>