-
Notifications
You must be signed in to change notification settings - Fork 28
/
phpcs.xml
77 lines (60 loc) · 4.15 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
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0"?>
<ruleset>
<file>./</file>
<rule ref="Generic">
<exclude name="Generic.PHP.ClosingPHPTag.NotFound"/>
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"/>
<!-- We should decide on one of these. I vote for short only -->
<exclude name="Generic.Arrays.DisallowLongArraySyntax.Found"/>
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="Generic.Files.EndFileNoNewline.Found"/>
<!-- I vote for $x = "foo", one space before, one after only-->
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
<exclude name="Generic.Formatting.MultipleStatementAlignment.IncorrectWarning"/>
<!-- God, no... -->
<exclude name="Generic.Formatting.SpaceAfterNot.Incorrect"/>
<!-- We've a lot of multiline strings that use these. -->
<exclude name="Generic.Strings.UnnecessaryStringConcat.Found"/>
<!-- Silence these until we fix our formatting, indentation, whitespace -->
<exclude name="Generic.Files.LineLength.MaxExceeded"/>
<exclude name="Generic.Files.LineLength.TooLong"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
<exclude name="Generic.Arrays.ArrayIndent.KeyIncorrect"/>
<exclude name="Generic.Arrays.ArrayIndent.CloseBraceNotNewLine"/>
<exclude name="Generic.Arrays.ArrayIndent.CloseBraceIncorrect"/>
<exclude name="Generic.Formatting.SpaceAfterCast.NoSpace"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterEquals"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma"/>
<!-- If we want to align args over multiple fn calls, this needs to be off-->
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
<!-- We *really* should fix this, as if-then-else blocks without braces are
very error prone, but we've a tonne of these in the codebase -->
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
<!-- TRUE, FALSE, NULL are case insensitive. We use a mix. -->
<exclude name="Generic.PHP.LowerCaseConstant.Found"/>
<exclude name="Generic.PHP.UpperCaseConstant.Found"/>
<!-- Our naming conventions are inconsistent, much like PHP itself... -->
<exclude name="Generic.NamingConventions.CamelCapsFunctionName.NotCamelCaps"/>
<exclude name="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps"/>
<exclude name="Generic.Files.LowercasedFilename.NotFound"/>
<!-- Personally, I like K&R, ie function foo (arg) {, because vertical space
is precious, but we mostly don't use it. -->
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine"/>
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace"/>
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceSpacing"/>
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.ContentAfterBrace"/>
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine"/>
<exclude name="Generic.Classes.OpeningBraceSameLine.BraceOnNewLine"/>
<!-- This is used a lot for while ($row = mysqli(...)) { ... } -->
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.Found"/>
<!-- Occasionally these make sense... -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
<exclude name="Generic.Files.OneClassPerFile.MultipleFound"/>
<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound"/>
</rule>
</ruleset>