Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4a6c5e3

Browse files
committed
Add new sniffs
1 parent 66f7469 commit 4a6c5e3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

‎MO4/ruleset.xml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@
8686
<!-- Require exactly one blank line after trait use -->
8787
<rule ref="PSR12.Traits.UseDeclaration"/>
8888

89+
<!-- Forbid whitespace between array access operator and the variable or between array access operators. -->
90+
<rule ref="SlevomatCodingStandard.Arrays.ArrayAccess"/>
91+
<!-- Sort attributes alphabetically -->
92+
<rule ref="SlevomatCodingStandard.Attributes.AttributesOrder">
93+
<properties>
94+
<property name="orderAlphabetically" value="true"/>
95+
</properties>
96+
</rule>
97+
<!-- Disallow multiple attributes inside one #[] -->
98+
<rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/>
99+
<!-- Require only one attribute per line -->
100+
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
101+
89102
<!-- Force Enum Spacing-->
90103
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/>
91104
<!-- Require presence of constant visibility -->
@@ -101,6 +114,15 @@
101114
<property name="linesCountBeforeClosingBrace" value="0"/>
102115
</properties>
103116
</rule>
117+
<!-- Forbid empty lines around Enum cases -->
118+
<rule ref="SlevomatCodingStandard.Classes.EnumCaseSpacing">
119+
<properties>
120+
<property name="minLinesCountBeforeWithComment" value="0"/>
121+
<property name="maxLinesCountBeforeWithComment" value="0"/>
122+
<property name="minLinesCountBeforeWithoutComment" value="0"/>
123+
<property name="maxLinesCountBeforeWithoutComment" value="0"/>
124+
</properties>
125+
</rule>
104126
<!-- Forbid properties to be public -->
105127
<rule ref="SlevomatCodingStandard.Classes.ForbiddenPublicProperty">
106128
<properties>
@@ -144,6 +166,8 @@
144166
<property name="ignoreMultiLine" value="true"/>
145167
</properties>
146168
</rule>
169+
<!-- Enforce consistent spacing of named arguments -->
170+
<rule ref="SlevomatCodingStandard.Functions.NamedArgumentSpacing"/>
147171
<!-- Require static closures for microoptimization -->
148172
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
149173
<!-- Forbid unused function parameters -->

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"php": "~7.2 || ~8.0",
2727
"dealerdirect/phpcodesniffer-composer-installer": "~0.7 || ~1.0",
2828
"escapestudios/symfony2-coding-standard": "^3.10.0",
29-
"slevomat/coding-standard": "^8.4",
29+
"slevomat/coding-standard": "^8.14",
3030
"squizlabs/php_codesniffer": "^3.6.2"
3131
},
3232
"require-dev": {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /