forked from enterprisemediawiki/WatchAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.phpcs.xml
42 lines (37 loc) · 1.85 KB
/
.phpcs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0"?>
<ruleset name="MediaWiki">
<file>.</file>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<!-- These exclusions taken from Extension:Echo and should be re-assessed -->
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
<!-- Allow non-wg prefix (e.g. $egWatchAnalyticsPageCounter) -->
<exclude name="MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix" />
<!-- Same as above, but for PHP 5.6 (using MW CodeSniffer 19.1.0) -->
<exclude name="MediaWiki.NamingConventions.ValidGlobalName.wgPrefix" />
<!-- Allow type-hinting for scalars (e.g. int $myInt, string $myString) -->
<exclude name="MediaWiki.PHP70Features.ScalarTypeHintUsage.Found" />
<exclude name="MediaWiki.PHP70Features.ScalarTypeHintUsage.ReturnTypeFound" />
<!--
Consider fixing while( $var = something() ) due to this:
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Assignment_expressions
-->
<exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
<!--
This exclusion required because we use the database query() function directly rather
than using select() or other more specific functions
-->
<exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="140" />
</properties>
</rule>
<arg name="encoding" value="UTF-8" />
<arg name="extensions" value="php,php5,inc" />
<arg name="colors" />
</ruleset>