-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp-coding-standard.xml
More file actions
101 lines (101 loc) · 7.04 KB
/
php-coding-standard.xml
File metadata and controls
101 lines (101 loc) · 7.04 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
<?xml version="1.0"?>
<ruleset name="WebServCo">
<description>A custom coding standard based on PSR12</description>
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="8.3"/>
<rule ref="PSR12"></rule>
<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps"/>
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml"><!-- relative path to your ruleset.xml -->
<!-- TODO investigate (seems to be a bug / conflict with won rules) -->
<exclude name="SlevomatCodingStandard.Classes.TraitUseSpacing.IncorrectLinesCountAfterLastUse" />
<!-- TODO investigate (seems to conflict with own rules and also with PSR2) -->
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" />
<!-- TODO investigate (conflicts with SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure) -->
<exclude name="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing.IncorrectLinesCountAfterLastControlStructure" />
<exclude name="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing.IncorrectLinesCountBeforeControlStructure" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.Commenting.DisallowCommentAfterCode.DisallowedCommentAfterCode" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator" />
<!-- TODO investigate (if fix code, opposite error happens) -->
<exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator.RequiredNumericLiteralSeparator" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn.UselessIfCondition" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowEmpty.DisallowedEmpty" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLineDocComment.MultiLineDocComment" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
<!-- TODO investigate -->
<exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint" />
<!-- Conflicts with PSR12 -->
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectWhitespaceBetweenOpenTagAndDeclare" />
<!-- Conflicts with PSR12 -->
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectStrictTypesFormat" />
<!-- Conflicts with PSR12 -->
<exclude name="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces.NoEmptyLineAfterOpeningBrace" />
<!-- Conflicts with PSR12 -->
<exclude name="SlevomatCodingStandard.Classes.TraitUseSpacing.IncorrectLinesCountBeforeFirstUse" />
<!-- Conflicts with PSR2 -->
<exclude name="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces.NoEmptyLineBeforeClosingBrace" />
<!-- Conflicts with PSR2 -->
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure" />
<!-- "Reports use of superfluous prefix or suffix "Abstract" for abstract classes." -->
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix" />
<!--"Reports use of superfluous suffix "Trait" for traits." -->
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming.SuperfluousSuffix" />
<!-- "Superfluous suffix "Exception"." -->
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix" />
<!-- "Superfluous suffix "Error"." -->
<exclude name="SlevomatCodingStandard.Classes.SuperfluousErrorNaming.SuperfluousSuffix" />
<!-- Superfluous suffix "Interface". -->
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix" />
<!-- "This sniff reduces confusion [..]" -->
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.NonFullyQualifiedException" />
<!-- Opposite error if fixed -->
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.UselessParentheses" />
<!-- Opposite error if fixed -->
<exclude name="SlevomatCodingStandard.Functions.DisallowArrowFunction.DisallowedArrowFunction" />
<!-- Special situation for I18nHelper -->
<exclude name="SlevomatCodingStandard.Namespaces.NamespaceDeclaration.DisallowedBracketedSyntax" />
<!-- WONTFIX -->
<exclude name="SlevomatCodingStandard.Classes.RequireAbstractOrFinal.ClassNeitherAbstractNorFinal" />
<exclude name="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall.DisallowedTrailingComma" />
<exclude name="SlevomatCodingStandard.Files.FunctionLength.FunctionLength" />
<exclude name="SlevomatCodingStandard.Functions.FunctionLength.FunctionLength" />
<exclude name="SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh" />
<exclude name="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion.RequiredConstructorPropertyPromotion" />
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration.MissingTrailingComma" />
<exclude name="SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable" />
<exclude name="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch.NonCapturingCatchRequired" />
<exclude name="SlevomatCodingStandard.Files.FileLength.FileTooLong" />
<exclude name="SlevomatCodingStandard.Classes.ClassLength.ClassTooLong" />
<exclude name="SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty" />
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint" />
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint" />
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint" />
<properties>
<!-- Namespaces that are allowed to be `use`d -->
<property name="namespacesRequiredToUse" type="array">
<element key="1" value="PHPUnit"/>
<element key="2" value="WebServCo"/>
</property>
<!-- SlevomatCodingStandard.Files.TypeNameMatchesFileName -->
<property name="rootNamespaces" type="array">
<element key="src/WebServCo" value="WebServCo"/>
<element key="tests/unit/WebServCo" value="Tests"/>
</property>
<!-- "allows using fully qualified classes from global space (i.e. \DateTimeImmutable)". -->
<property name="allowFullyQualifiedGlobalClasses" value="true" />
<!-- "allows using fully qualified functions from global space (i.e. \phpversion())". -->
<property name="allowFullyQualifiedGlobalFunctions" value="true" />
<property name="maxLineLength" value="120" />
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true" />
</properties>
</rule>
</ruleset>