Skip to content

Commit 6087871

Browse files
Add another 7 rules
1 parent d9fae38 commit 6087871

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

docs/rules.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11

2-
The DanielEScherzer standard contains 159 sniffs
2+
The DanielEScherzer standard contains 166 sniffs
33

44
CommonPhpcs (1 sniff)
55
---------------------
66
CommonPhpcs.Attributes.AttributeAlignment
77

8-
Generic (41 sniffs)
8+
Generic (43 sniffs)
99
-------------------
1010
Generic.Arrays.DisallowLongArraySyntax
1111
Generic.Classes.DuplicateClassName
1212
Generic.CodeAnalysis.AssignmentInCondition
1313
Generic.CodeAnalysis.EmptyPHPStatement
14+
Generic.CodeAnalysis.EmptyStatement
1415
Generic.CodeAnalysis.ForLoopShouldBeWhileLoop
1516
Generic.CodeAnalysis.JumbledIncrementer
1617
Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence
@@ -19,6 +20,7 @@ Generic (41 sniffs)
1920
Generic.ControlStructures.DisallowYodaConditions
2021
Generic.ControlStructures.InlineControlStructure
2122
Generic.Files.ByteOrderMark
23+
Generic.Files.InlineHTML
2224
Generic.Files.LineEndings
2325
Generic.Files.LineLength
2426
Generic.Files.OneObjectStructurePerFile
@@ -114,6 +116,10 @@ PEAR (1 sniff)
114116
--------------
115117
PEAR.Functions.ValidDefaultValue
116118

119+
PSR1 (1 sniff)
120+
--------------
121+
PSR1.Files.SideEffects
122+
117123
PSR2 (9 sniffs)
118124
---------------
119125
PSR2.Classes.ClassDeclaration
@@ -126,8 +132,9 @@ PSR2 (9 sniffs)
126132
PSR2.Namespaces.NamespaceDeclaration
127133
PSR2.Namespaces.UseDeclaration
128134

129-
PSR12 (6 sniffs)
135+
PSR12 (7 sniffs)
130136
----------------
137+
PSR12.Classes.ClassInstantiation
131138
PSR12.Files.ImportStatement
132139
PSR12.Functions.NullableTypeDeclaration
133140
PSR12.Functions.ReturnTypeDeclaration
@@ -172,13 +179,16 @@ Squiz (22 sniffs)
172179
Squiz.WhiteSpace.SemicolonSpacing
173180
Squiz.WhiteSpace.SuperfluousWhitespace
174181

175-
Universal (11 sniffs)
182+
Universal (14 sniffs)
176183
---------------------
177184
Universal.CodeAnalysis.NoDoubleNegative
178185
Universal.Constants.LowercaseClassResolutionKeyword
179186
Universal.Constants.UppercaseMagicConstants
180187
Universal.ControlStructures.DisallowAlternativeSyntax
181188
Universal.Lists.DisallowLongListSyntax
189+
Universal.NamingConventions.NoReservedKeywordParameterNames
190+
Universal.Operators.DisallowLogicalAndOr
191+
Universal.Operators.StrictComparisons
182192
Universal.Operators.TypeSeparatorSpacing
183193
Universal.PHP.LowercasePHPTag
184194
Universal.UseStatements.KeywordSpacing

src/Tests/bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
declare( strict_types = 1 );
33

4+
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
5+
46
require_once __DIR__ . '/../../vendor/autoload.php';
57

68
// For some reason the classes from codesniffer need to be loaded separately

src/ruleset.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@
4848
</rule>
4949

5050
<!-- Some extra rules that seem useful from PHPCS core -->
51+
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
52+
<rule ref="Generic.Files.InlineHTML" />
5153
<rule ref="Generic.PHP.DeprecatedFunctions" />
54+
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols" />
55+
<rule ref="PSR12.Classes.ClassInstantiation.MissingParentheses" />
56+
57+
<!-- phpcsstandards/phpcsextra rules -->
58+
<rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames" />
59+
<rule ref="Universal.Operators.DisallowLogicalAndOr" />
60+
<rule ref="Universal.Operators.StrictComparisons" />
5261

5362
<!-- SlevomatCodingStandard rules -->
5463
<rule ref="SlevomatCodingStandard.Attributes.AttributesOrder">

0 commit comments

Comments
 (0)