-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphpcs.xml
More file actions
107 lines (98 loc) · 5.09 KB
/
Copy pathphpcs.xml
File metadata and controls
107 lines (98 loc) · 5.09 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="PHP_CodeSniffer">
<description>The coding standard for our project.</description>
<rule ref="PSR1">
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>
<rule ref="PSR2">
<!-- https://stackoverflow.com/questions/37399031/php-codesniffer-ignore-exclude-underscore-rule-in-methods/37401598#37401598 -->
<!-- This rule forces braces of multiline functions to be on the same line -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.NewlineBeforeOpenBrace"/>
<!-- Forces ternary statements to be on a single line -->
<exclude name="Squiz.WhiteSpace.OperatorSpacing.SpacingBefore"/>
</rule>
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<rule ref="PSR2.Namespaces.UseDeclaration"/>
<rule ref="PSR12.Operators.OperatorSpacing"/>
<!--http://edorian.github.io/php-coding-standard-generator/#phpcs-->
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<!-- A hard limit for errors is nice, but it also counts things like translation strings, which when compacted don't always read nice -->
<!-- <property name="absoluteLineLimit" value="200"/>-->
</properties>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="eval" value="null"/>
<element key="dd" value="null"/>
<element key="dump" value="null"/>
<element key="die" value="null"/>
<element key="var_dump" value="null"/>
<element key="sizeof" value="count"/>
<element key="delete" value="unset"/>
<element key="print" value="echo"/>
<element key="create_function" value="null"/>
</property>
</properties>
</rule>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
<rule ref="PEAR.ControlStructures.ControlSignature">
<properties>
<property name="ignoreComments" value="false"/>
</properties>
</rule>
<rule ref="PEAR.Formatting.MultiLineAssignment"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
<!-- TODO: PHP Unit currently not available -->
<!--<rule ref="PHPUnitStandard.Testing.FileNameSuffix"/>-->
<!--<rule ref="PHPUnitStandard.Testing.NoOutputFunctions"/>-->
<!--<rule ref="PHPUnitStandard.Testing.NoOutputStatements"/>-->
<!--<rule ref="PHPUnitStandard.Testing.TestOrProviderIsPublic"/>-->
<!--<rule ref="PHPUnitStandard.Testing.UnusedProvider"/>-->
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<!-- THIS ALSO DOES NOT ALLOW NEW LINES FOR OPERATORS, WHICH WE DO ACTUALLY WANT -->
<!--<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"/>-->
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<!-- HANDLED VIA PEAR.WhiteSpace.ScopeClosingBrace -->
<!--<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>-->
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>storage/*</exclude-pattern>
<exclude-pattern>bootstrap/*</exclude-pattern>
<exclude-pattern>public/*</exclude-pattern>
<exclude-pattern>*/migrations/*</exclude-pattern>
<exclude-pattern>*/seeds/*</exclude-pattern>
<exclude-pattern>*.blade.php</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
</ruleset>