Skip to content

Commit

Permalink
fix standards
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jul 2, 2024
1 parent b4bef3b commit 63b4b46
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/Standards/AcquiaEdge/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,4 @@

<description>Acquia's Edge (backwards-incompatible) coding standards.</description>

<!-- Acquia PHP sniffs -->
<rule ref="AcquiaPHP"/>

<!-- SlevomatCodingStandard sniffs -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing" />
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />

</ruleset>
10 changes: 9 additions & 1 deletion src/Standards/AcquiaPHP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<description>Acquia's PHP coding standards.</description>

<rule ref="PSR12" />
<rule ref="PSR12"/>

<!-- Internal sniffs -->
<rule ref="Internal.NoCodeFound">
Expand All @@ -27,4 +27,12 @@
<exclude name="PHPCompatibility.Extensions.RemovedExtensions.famRemoved"/>
</rule>

<!-- PSR-12 has no opinion on comments, leading to unpredictable indentation. -->
<!-- @see https://github.com/squizlabs/PHP_CodeSniffer/issues/2314 -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="ignoreIndentationTokens" type="array"/>
</properties>
</rule>

</ruleset>
39 changes: 38 additions & 1 deletion src/Standards/AcquiaPHPStrict/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,46 @@

<rule ref="AcquiaPHP"/>

<!-- Drupal sniffs -->
<rule ref="Drupal.Commenting.InlineComment"/>

<!-- SlevomatCodingStandard sniffs -->
<rule ref="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys" />
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"/>
<rule ref="SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement"/>
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion" />
<rule ref="SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration" />
<rule ref="SlevomatCodingStandard.Commenting.DisallowCommentAfterCode" />
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing" />
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array" value="@author,@created,@version,@package,@copyright,@license,@throws" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array" value="/Class .*/" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration" />
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment" />
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment" />
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint" />
<!-- Stock configuration conflicts with PSR-12, which requires no spaces. -->
<!-- @see https://www.php-fig.org/psr/psr-12/#3-declare-statements-namespace-and-import-statements -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="linesCountBeforeDeclare" value="1"/>
<property name="linesCountAfterDeclare" value="1"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint" />
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint" />
<!-- Superglobals are superbad. See linked issue for discussion.
Expand Down

0 comments on commit 63b4b46

Please sign in to comment.