Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 43 additions & 12 deletions WPTechnix/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
<properties>
<property name="checkPromoted" value="true" />
<property name="allowReadonly" value="true" />
<property name="allowNonPublicSet" value="true" />
</properties>
</rule>

Expand Down Expand Up @@ -433,7 +434,16 @@

<rule ref="SlevomatCodingStandard.Classes.RequireSelfReference"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBeforeFirstUseWhenFirstInClass" value="0"/>
<property name="linesCountBetweenUses" value="0"/>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountAfterLastUseWhenLastInClass" value="1"/>
</properties>
</rule>

<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding"/>

<!-- ################################################################## -->
Expand Down Expand Up @@ -587,7 +597,11 @@

<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator">
<properties>
<property name="ignoreMultiLine" value="false" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"/>
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/>

Expand All @@ -603,8 +617,6 @@
</properties>
</rule>

<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"/>

<!-- ################################################################## -->
<!-- ## FUNCTIONS ## -->
<!-- ################################################################## -->
Expand Down Expand Up @@ -650,13 +662,32 @@

<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="allowFullyQualifiedGlobalClasses" value="false"/>

<!-- ALLOW USING BUILT-IN GLOBAL FUNCTIONS WITHOUT IMPORTS -->
<property name="allowFallbackGlobalFunctions" value="true"/>

<!-- ALLOW USING BUILT-IN GLOBAL CONSTANTS WITHOUT IMPORTS -->
<property name="allowFallbackGlobalConstants" value="true"/>

<!-- ALLOW USING BUILT-IN CLASSES/FUNCTIONS/CONSTANTS WITH LEADING \ -->
<property name="allowFullyQualifiedGlobalClasses" value="true"/>
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
<property name="allowFallbackGlobalFunctions" value="false"/>
<property name="allowFallbackGlobalConstants" value="false"/>

<!-- DISALLOW PARTIAL NAMESPACE IMPORTS (best practice) -->
<property name="allowPartialUses" value="false"/>

<!-- KEEP DEFAULT BEHAVIOR EVEN IN FILES WITHOUT A NAMESPACE -->
<property name="allowWhenNoNamespace" value="true"/>

<!-- KEEP DEFAULTS FOR ADVANCED OPTIONS YOU DO NOT NEED -->
<!-- searchAnnotations: leave false -->
<!-- namespacesRequiredToUse: leave unset -->
<!-- allowFullyQualifiedExceptions: leave unset -->
<!-- specialExceptionNames: leave unset -->
<!-- ignoredNames: leave unset -->
<!-- allowFullyQualifiedNameForColliding*: leave unset -->

</properties>
</rule>

Expand Down Expand Up @@ -723,7 +754,7 @@

<rule ref="SlevomatCodingStandard.PHP.UselessParentheses">
<properties>
<property name="ignoreComplexTernaryConditions" value="false"/>
<property name="ignoreComplexTernaryConditions" value="true" />
</properties>
</rule>

Expand Down Expand Up @@ -814,10 +845,10 @@
</properties>
</rule>
<rule ref="Squiz.Commenting.VariableComment" />
<!-- <rule ref="Squiz.Commenting.BlockComment" />-->
<!-- <rule ref="Squiz.Commenting.FileComment" />-->
<!-- <rule ref="Squiz.Commenting.BlockComment" />-->
<!-- <rule ref="Squiz.Commenting.FileComment" />-->
<rule ref="Squiz.Commenting.ClassComment" />
<!-- <rule ref="Squiz.Commenting.FunctionComment"/>-->
<!-- <rule ref="Squiz.Commenting.FunctionComment"/>-->
<rule ref="Squiz.Commenting.InlineComment" />
<rule ref="PEAR.Commenting.InlineComment"/>

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"php": "^8.0",
"squizlabs/php_codesniffer": "^3.13.0 || ^4.0",
"phpcsstandards/phpcsextra": "^1.4",
"slevomat/coding-standard": "^8.0"
"slevomat/coding-standard": "^8.22"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "For automatic registration of the coding standard with PHP_CodeSniffer"
Expand Down