Skip to content

Commit

Permalink
Add Attribute sniffs
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Dec 8, 2023
1 parent 6794b54 commit 6bfa457
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions MO4/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@
<!-- Require exactly one blank line after trait use -->
<rule ref="PSR12.Traits.UseDeclaration"/>

<!-- Sort attributes alphabetically -->
<rule ref="SlevomatCodingStandard.Attributes.AttributesOrder">
<properties>
<property name="orderAlphabetically" value="true"/>
</properties>
</rule>
<!-- Attributes should be adjoined to the PHP element they belong to -->
<rule ref="SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing"/>
<!-- Disallow multiple attributes inside one #[] -->
<rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/>
<!-- Require only one attribute per line -->
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<!-- Require PHPDoc always before attributes -->
<rule ref="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment"/>

<!-- Force Enum Spacing-->
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/>
<!-- Require presence of constant visibility -->
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"php": "~7.2 || ~8.0",
"dealerdirect/phpcodesniffer-composer-installer": "~0.7 || ~1.0",
"escapestudios/symfony2-coding-standard": "^3.10.0",
"slevomat/coding-standard": "^8.4",
"slevomat/coding-standard": "^8.7",
"squizlabs/php_codesniffer": "^3.6.2"
},
"require-dev": {
Expand Down

0 comments on commit 6bfa457

Please sign in to comment.