generated from spaceemotion/laravel-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
127 lines (120 loc) · 6.53 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version="1.0"?>
<ruleset name="PSR12Plus">
<description>PSR-12 with some stricter rules</description>
<!-- Configuration -->
<config name="show_progress" value="1" />
<config name="installed_paths" value="../../slevomat/coding-standard,../../escapestudios/symfony2-coding-standard"/>
<arg value="p"/>
<arg name="colors"/>
<arg name="encoding" value="utf-8"/>
<!-- Ruleset base -->
<rule ref="PSR12">
<!-- Allow method names like "it_validates_a_request" in tests -->
<exclude name="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>tests/*</exclude-pattern>
</exclude>
</rule>
<!-- Harsher coding standard -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
<property name="newlinesCountAfterDeclare" value="2"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation" />
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" />
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit" />
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" />
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" />
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses" />
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" />
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable" />
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" />
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma" />
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference" />
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
<properties>
<property name="linesCountBeforeControlStructure" value="1" />
<property name="linesCountAfterControlStructure" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing">
<properties>
<property name="allowSingleLineYieldStacking" value="1" />
<property name="linesCountAfterControlStructure" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator" />
<rule ref="SlevomatCodingStandard.Functions.TrailingCommaInCall" />
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="caseSensitive" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile" />
<rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint" />
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints" />
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
<rule ref="SlevomatCodingStandard.PHP.ShortList" />
<rule ref="SlevomatCodingStandard.PHP.TypeCast" />
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array" value="@author, @created, @version, @package, @copyright, @license" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array" value="/PhpStorm/, /Constructor/, /Class/" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration" />
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment" />
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment" />
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
<rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator" />
<rule ref="Symfony.Classes.PropertyDeclaration" />
<rule ref="Symfony.Formatting.BlankLineBeforeReturn" />
<rule ref="Symfony.Formatting.ReturnOrThrow" />
<rule ref="Symfony.Errors.ExceptionMessage" />
<rule ref="Symfony.Files.AlphanumericFilename">
<exclude-pattern>config/*</exclude-pattern>
</rule>
<!-- Some custom formatting preferences -->
<rule ref="Generic.Arrays.ArrayIndent">
<exclude name="Generic.Arrays.ArrayIndent.CloseBraceNotNewLine"/>
</rule>
<file>config</file>
<file>src</file>
<file>tests</file>
</ruleset>