fb9d232605e1b6f01a309146e21eeabd21d1cecb
[lhc/web/wiklou.git] / .phpcs.xml
1 <?xml version="1.0"?>
2 <ruleset name="MediaWiki">
3 <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
4 <exclude name="Generic.ControlStructures.InlineControlStructure" />
5 <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
6 <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
7 <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
8 <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
9 <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
10 <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
11 <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
12 <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
13 <exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
14 <exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
15 <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
16 <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
17 <exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
18 <exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
19 <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" />
20 <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
21 <exclude name="MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle" />
22 <exclude name="Squiz.Scope.MethodScope.Missing" />
23 <exclude name="Squiz.Scope.MemberVarScope.Missing" />
24 <exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
25 </rule>
26 <rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
27 <properties>
28 <!--
29 includes/compat/normal/UtfNormalUtil.php
30 * codepointToUtf8
31 * escapeSingleString
32 * hexSequenceToUtf8
33 * utf8ToCodepoint
34 * utf8ToHexSequence
35 includes/GlobalFunctions.php
36 * mimeTypeMatch
37 maintenance/benchmarks/bench_strtr_str_replace.php
38 * bfNormalizeTitleStrReplace
39 * bfNormalizeTitleStrTr
40 maintenance/cdb.php
41 * cdbShowHelp
42 maintenance/language/transstat.php
43 * showUsage
44 maintenance/mcc.php
45 * mccGetHelp
46 * mccShowUsage
47 maintenance/storage/moveToExternal.php
48 * moveToExternal
49 maintenance/storage/resolveStubs.php
50 * resolveStub
51 * resolveStubs
52 profileinfo.php
53 * compare_point
54 * getEscapedProfileUrl
55 tests/phpunit/includes/HooksTest.php
56 * NothingFunction
57 * NothingFunctionData
58 tests/qunit/data/styleTest.css.php
59 * cssfilter
60 -->
61 <property name="ignoreList" type="array" value="bfNormalizeTitleStrReplace,bfNormalizeTitleStrTr,cdbShowHelp,codepointToUtf8,compare_point,cssfilter,escapeSingleString,getEscapedProfileUrl,hexSequenceToUtf8,mccGetHelp,mccShowUsage,mimeTypeMatch,moveToExternal,NothingFunction,NothingFunctionData,resolveStub,resolveStubs,showUsage,utf8ToCodepoint,utf8ToHexSequence" />
62 </properties>
63 </rule>
64 <rule ref="MediaWiki.NamingConventions.ValidGlobalName">
65 <properties>
66 <property name="ignoreList" type="array" value="$IP,$messageMemc,$parserMemc" />
67 </properties>
68 </rule>
69 <rule ref="Generic.Files.LineLength">
70 <exclude-pattern>*/languages/messages/Messages*\.php</exclude-pattern>
71 </rule>
72 <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
73 <!--
74 Whitelist existing violations, but enable the sniff to prevent
75 any new occurrences.
76 -->
77 <exclude-pattern>*/includes/actions/HistoryAction\.php</exclude-pattern>
78 <exclude-pattern>*/includes/api/ApiErrorFormatter\.php</exclude-pattern>
79 <exclude-pattern>*/includes/api/ApiImport\.php</exclude-pattern>
80 <exclude-pattern>*/includes/api/ApiMessage\.php</exclude-pattern>
81 <exclude-pattern>*/includes/api/ApiOpenSearch\.php</exclude-pattern>
82 <exclude-pattern>*/includes/api/ApiRsd\.php</exclude-pattern>
83 <exclude-pattern>*/includes/api/ApiUsageException\.php</exclude-pattern>
84 <exclude-pattern>*/includes/auth/AuthManagerAuthPlugin\.php</exclude-pattern>
85 <exclude-pattern>*/includes/AuthPlugin\.php</exclude-pattern>
86 <exclude-pattern>*/includes/cache/CacheDependency\.php</exclude-pattern>
87 <exclude-pattern>*/includes/cache/CacheHelper\.php</exclude-pattern>
88 <exclude-pattern>*/includes/deferred/CdnCacheUpdate\.php</exclude-pattern>
89 <exclude-pattern>*/includes/diff/DairikiDiff\.php</exclude-pattern>
90 <exclude-pattern>*/includes/diff/DiffEngine\.php</exclude-pattern>
91 <exclude-pattern>*/includes/exception/LocalizedException\.php</exclude-pattern>
92 <exclude-pattern>*/includes/Feed\.php</exclude-pattern>
93 <exclude-pattern>*/includes/filerepo/file/LocalFile\.php</exclude-pattern>
94 <exclude-pattern>*/includes/gallery/PackedOverlayImageGallery\.php</exclude-pattern>
95 <exclude-pattern>*/includes/HistoryBlob\.php</exclude-pattern>
96 <exclude-pattern>*/includes/htmlform/HTMLFormElement\.php</exclude-pattern>
97 <exclude-pattern>*/includes/jobqueue/aggregator/JobQueueAggregator\.php</exclude-pattern>
98 <exclude-pattern>*/includes/jobqueue/JobQueue\.php</exclude-pattern>
99 <exclude-pattern>*/includes/jobqueue/JobSpecification\.php</exclude-pattern>
100 <exclude-pattern>*/includes/libs/filebackend/FileBackendStore\.php</exclude-pattern>
101 <exclude-pattern>*/includes/libs/filebackend/FSFileBackend\.php</exclude-pattern>
102 <exclude-pattern>*/includes/libs/filebackend/SwiftFileBackend\.php</exclude-pattern>
103 <exclude-pattern>*/includes/logging/LogEntry\.php</exclude-pattern>
104 <exclude-pattern>*/includes/logging/LogFormatter\.php</exclude-pattern>
105 <exclude-pattern>*/includes/media/MediaTransformOutput\.php</exclude-pattern>
106 <exclude-pattern>*/includes/media/SVGMetadataExtractor\.php</exclude-pattern>
107 <exclude-pattern>*/includes/parser/Preprocessor_DOM\.php</exclude-pattern>
108 <exclude-pattern>*/includes/parser/Preprocessor_Hash\.php</exclude-pattern>
109 <exclude-pattern>*/includes/parser/Preprocessor\.php</exclude-pattern>
110 <exclude-pattern>*/includes/PathRouter\.php</exclude-pattern>
111 <exclude-pattern>*/includes/poolcounter/PoolCounter\.php</exclude-pattern>
112 <exclude-pattern>*/includes/PrefixSearch\.php</exclude-pattern>
113 <exclude-pattern>*/includes/profiler/SectionProfiler\.php</exclude-pattern>
114 <exclude-pattern>*/includes/RevisionList\.php</exclude-pattern>
115 <exclude-pattern>*/includes/search/SearchEngine\.php</exclude-pattern>
116 <exclude-pattern>*/includes/specialpage/LoginSignupSpecialPage\.php</exclude-pattern>
117 <exclude-pattern>*/includes/specialpage/RedirectSpecialPage\.php</exclude-pattern>
118 <exclude-pattern>*/includes/specials/SpecialListusers\.php</exclude-pattern>
119 <exclude-pattern>*/includes/specials/SpecialMyRedirectPages\.php</exclude-pattern>
120 <exclude-pattern>*/includes/specials/SpecialUploadStash\.php</exclude-pattern>
121 <exclude-pattern>*/includes/StubObject\.php</exclude-pattern>
122 <exclude-pattern>*/includes/upload/UploadFromChunks\.php</exclude-pattern>
123 <exclude-pattern>*/includes/upload/UploadStash\.php</exclude-pattern>
124 <exclude-pattern>*/includes/utils/AutoloadGenerator\.php</exclude-pattern>
125 <exclude-pattern>*/includes/WebResponse\.php</exclude-pattern>
126 <exclude-pattern>*/maintenance/dumpIterator\.php</exclude-pattern>
127 <exclude-pattern>*/maintenance/Maintenance\.php</exclude-pattern>
128 <exclude-pattern>*/maintenance/findDeprecated\.php</exclude-pattern>
129 <exclude-pattern>*/maintenance/storage/recompressTracked\.php</exclude-pattern>
130 <exclude-pattern>*/maintenance/preprocessorFuzzTest\.php</exclude-pattern>
131 <exclude-pattern>*/maintenance/language/languages.inc</exclude-pattern>
132 <exclude-pattern>*/maintenance/language/StatOutputs\.php</exclude-pattern>
133 <exclude-pattern>*/maintenance/language/checkLanguage.inc</exclude-pattern>
134 <exclude-pattern>*/maintenance/language/generateCollationData\.php</exclude-pattern>
135 <exclude-pattern>*/maintenance/term/MWTerm\.php</exclude-pattern>
136 <!-- Language converters use the pattern of 2 classes in one file -->
137 <exclude-pattern>*/languages/*\.php</exclude-pattern>
138 <!-- We don't care that much about violations in tests -->
139 <exclude-pattern>*/tests/*\.php</exclude-pattern>
140 </rule>
141 <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
142 <exclude-pattern>*/includes/StubObject\.php</exclude-pattern>
143 </rule>
144 <rule ref="MediaWiki.Usage.AssignmentInReturn.AssignmentInReturn">
145 <exclude-pattern>*/tests/phpunit/*\.php</exclude-pattern>
146 </rule>
147 <file>.</file>
148 <arg name="encoding" value="UTF-8"/>
149 <arg name="extensions" value="php,php5,inc,sample"/>
150 <exclude-pattern type="relative">^extensions/</exclude-pattern>
151 <exclude-pattern type="relative">^skins/</exclude-pattern>
152 <exclude-pattern>AdminSettings\.php</exclude-pattern>
153 <exclude-pattern>LocalSettings\.php</exclude-pattern>
154 <exclude-pattern>StartProfiler\.php</exclude-pattern>
155 </ruleset>