Skip to content

Commit

Permalink
Merge pull request #362 from Yoast/JRF/yoastcs-more-code-structure-rules
Browse files Browse the repository at this point in the history
YoastCS: more code structure rules
  • Loading branch information
jrfnl authored Dec 14, 2023
2 parents 12e1d05 + 02d8905 commit 39e325a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Yoast/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,32 @@
SNIFFS RELATED TO CODE STRUCTURING
#############################################################################
-->
<!-- CS/QA: Enforce consistent order of OO structures. -->
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
<properties>
<property name="groups" type="array">
<element value="uses"/>
<element value="enum cases"/>
<element value="constants"/>
<element value="properties"/>
<element value="methods"/>
</property>
</properties>
</rule>

<!-- CS: ensure exactly one blank line before each property declaration. -->
<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>

<!-- CS/QA: Forbid the use long closures. Use named functions instead. -->
<rule ref="Universal.FunctionDeclarations.NoLongClosures">
<properties>
<property name="maxLines" value="10"/>
</properties>

<!-- Disable the warning, only have an error. -->
<exclude name="Universal.FunctionDeclarations.NoLongClosures.ExceedsRecommended"/>
</rule>


<!--
#############################################################################
Expand Down

0 comments on commit 39e325a

Please sign in to comment.