|
4 | 4 | Proton PHP Coding Standard
|
5 | 5 | </description>
|
6 | 6 |
|
7 |
| - <rule ref="PSR2" /> |
| 7 | + <rule ref="PSR2"> |
| 8 | + <!-- Checked by SlevomatCodingStandard.Namespaces.UseSpacing --> |
| 9 | + <exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/> |
| 10 | + <!-- Checked by SlevomatCodingStandard.Namespaces.NamespaceSpacing --> |
| 11 | + <exclude name="PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter"/> |
| 12 | + </rule> |
| 13 | + |
8 | 14 | <rule ref="PSR2.Namespaces.UseDeclaration">
|
9 | 15 | <!-- Allows compound namespaces -->
|
10 | 16 | <exclude-pattern>*</exclude-pattern>
|
11 | 17 | </rule>
|
| 18 | + |
12 | 19 | <rule ref="PSR12.Namespaces.CompoundNamespaceDepth"/>
|
13 | 20 | <rule ref="PSR12.Functions.NullableTypeDeclaration"/>
|
14 | 21 |
|
| 22 | + <rule ref="PEAR.Commenting.InlineComment"/> |
| 23 | + |
15 | 24 | <rule ref="Generic.Commenting.Todo"/>
|
16 | 25 | <rule ref="Generic.PHP.LowerCaseKeyword"/>
|
17 | 26 | <rule ref="Generic.PHP.DeprecatedFunctions"/>
|
|
21 | 30 | <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
|
22 | 31 | <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
23 | 32 | <rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/>
|
| 33 | + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> |
24 | 34 | <rule ref="Generic.Classes.DuplicateClassName"/>
|
25 | 35 | <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
|
26 | 36 | <rule ref="Generic.VersionControl.GitMergeConflict" />
|
| 37 | + <rule ref="Generic.Files.OneClassPerFile"/> |
| 38 | + <rule ref="Generic.Files.OneInterfacePerFile"/> |
27 | 39 |
|
28 | 40 | <!-- All PHP files MUST use the Unix LF (linefeed) line ending only. -->
|
29 | 41 | <rule ref="Generic.Files.LineEndings">
|
|
41 | 53 | <element key="print" value="echo"/>
|
42 | 54 | <element key="phpinfo" value="null"/>
|
43 | 55 | <element key="create_function" value="null"/>
|
| 56 | + <element key="doubleval" value="floatval"/> |
| 57 | + <element key="is_real" value="is_float"/> |
| 58 | + <element key="is_integer" value="is_int"/> |
| 59 | + <element key="is_double" value="is_float"/> |
| 60 | + <element key="join" value="implode"/> |
| 61 | + <element key="chop" value="rtrim"/> |
44 | 62 |
|
45 | 63 | <!-- Use `::class` keyword -->
|
46 | 64 | <element key="get_called_class" value="`static::class`"/>
|
|
69 | 87 | </properties>
|
70 | 88 | </rule>
|
71 | 89 |
|
| 90 | + <rule ref="Generic.Metrics.CyclomaticComplexity"> |
| 91 | + <properties> |
| 92 | + <property name="complexity" value="15"/> |
| 93 | + <property name="absoluteComplexity" value="25"/> |
| 94 | + </properties> |
| 95 | + </rule> |
| 96 | + |
72 | 97 | <rule ref="Squiz.PHP.NonExecutableCode"/>
|
73 | 98 | <rule ref="Squiz.PHP.LowercasePHPFunctions"/>
|
| 99 | + <!-- Forbid spaces around `->` operator --> |
| 100 | + <rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"> |
| 101 | + <properties> |
| 102 | + <property name="ignoreNewlines" value="true"/> |
| 103 | + </properties> |
| 104 | + </rule> |
74 | 105 |
|
75 | 106 | <!-- <rule ref="Squiz.Strings.ConcatenationSpacing">
|
76 | 107 | <properties>
|
|
115 | 146 | <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
|
116 | 147 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
|
117 | 148 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
|
| 149 | + <rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/> |
118 | 150 | <rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments"/>
|
119 | 151 | <rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/>
|
120 | 152 | <rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing">
|
|
137 | 169 | <!-- <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/> -->
|
138 | 170 | <!-- <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/> -->
|
139 | 171 | <!--<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>-->
|
140 |
| - |
| 172 | + |
141 | 173 | <!--
|
142 | 174 | If you want to completely disable an error message in a sniff
|
143 | 175 | but you don't want to exclude the whole sniff, you can
|
|
0 commit comments