-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
67 lines (62 loc) · 3.46 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0"?>
<!-- This is a ruleset for https://github.com/squizlabs/PHP_CodeSniffer -->
<!-- Usage: phpcs.phar \-\-standard=path/toruleset.xml path/to/file_or_folder.php (Can't have double hyphen in xml comment) -->
<!-- phpcbf.phar can be used to automatically fix many issues -->
<!-- Use this with PHP_CodeSniffer 3.3.0 or newer -->
<ruleset name="Custom Standard">
<description>Coding standard for Phan</description>
<!-- <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" /> doesn't account for 'use function...' statements, don't use that -->
<!-- Look into SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification if it ever supports generic arrays+array shapes - Or just add this functionality to Phan's annotation plugin -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference" />
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEmpty" />
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="psr12Compatible" type="bool" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator" />
<rule ref="SlevomatCodingStandard.PHP.ShortList" />
<rule ref="SlevomatCodingStandard.PHP.TypeCast" />
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" >
<properties>
<property name="spacesCountAroundEqualsSign" type="int" value="0" />
<property name="newlinesCountBetweenOpenTagAndDeclare" type="int" value="2" />
</properties>
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectWhitespaceBetweenOpenTagAndDeclare" />
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints" />
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/.phan/plugins/*</exclude-pattern>
<exclude-pattern>/internal/*</exclude-pattern>
</rule>
<rule ref="PSR1" />
<rule ref="PSR2">
<exclude name="Generic.Files.LineLength.TooLong" />
<!-- We put class initialization in the same file as methods -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses" />
</rule>
<rule ref="PSR12">
<!-- conflicts with PSR2.ControlStructures.ControlStructureSpacing, the automatic fixes have strange space -->
<exclude name="PSR12.ControlStructures.ControlStructureSpacing" />
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found" />
<!-- Arbitrary increase of the line length limit -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="150"/>
<property name="absoluteLineLimit" value="200"/>
</properties>
</rule>
<exclude name="Generic.WhiteSpace.ScopeIndent" />
<!-- Phan's coding style is to always use underscores for variable names and property declarations -->
<rule ref="./internal/PHP_CodeSniffer/Sniffs">
<exclude name="Phan.NamingConventions.ValidUnderscoreVariableName.ContainsNumbers" />
</rule>
</ruleset>