Files
ops-Gazelle/.phpcs.xml

100 lines
4.4 KiB
XML

<?xml version="1.0"?>
<ruleset name="Orpheus Standard" namespace="Orpheus\Standard">
<description>The standard for writing code for Orpheus</description>
<arg name="extensions" value="php" />
<arg name="colors"/>
<arg value="s"/>
<file>.</file>
<exclude-pattern>.git/*</exclude-pattern>
<exclude-pattern>cache/*</exclude-pattern>
<exclude-pattern>misc/docker/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>sass/*</exclude-pattern>
<exclude-pattern>static/*</exclude-pattern>
<exclude-pattern>templates/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<rule ref="PSR12">
<exclude name="Generic.Files.LineLength" />
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" />
<exclude name="Generic.NamingConventions.UpperCaseConstantName" />
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<exclude name="PSR2.Classes.PropertyDeclaration.SpacingAfterType" />
<exclude name="PSR2.Methods.FunctionCallSignature" />
<!-- compact phpstan-var declarations -->
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock" />
<!-- protected bool $var = false, align ='s in argument defaults -->
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing" />
<!-- K&R function x() { is fine -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<!-- function x() { return $x; } is ok -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace" />
<!-- <?php if (...) {} ?> is ok -->
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore" />
<!-- <?php } ?> is ok -->
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>classes/*</exclude-pattern>
<exclude-pattern>misc/my-migrations/*</exclude-pattern>
<exclude-pattern>misc/pg-migrations/*</exclude-pattern>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" extend="true">
<element key="each" value="null"/>
<element key="eval" value="null"/>
<element key="extract" value="null"/>
<!-- use is_int() instead -->
<element key="is_integer" value="null"/>
<!-- use hash('sha256', ...) instead -->
<element key="md5" value="null"/>
<element key="sha1" value="null"/>
<element key="uniqid" value="null"/>
<!-- use hash_file('sha256', ...) instead -->
<element key="sha1file" value="null"/>
<!-- use string equality instead: $x == $y -->
<element key="strcmp" value="null"/>
</property>
</properties>
<type>warning</type>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement" />
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter" />
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
<rule ref="Generic.Files.LineEndings" />
<rule ref="Generic.Files.OneClassPerFile" />
<rule ref="Generic.Formatting.NoSpaceAfterCast" />
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<rule ref="Generic.PHP.Syntax" />
<rule ref="PEAR.Files.IncludingFile" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" />
<rule ref="Squiz.ControlStructures.ForLoopDeclaration" />
<rule ref="Squiz.PHP.NonExecutableCode" />
<rule ref="Squiz.WhiteSpace.SemicolonSpacing" />
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0" />
<property name="spacingAfterLast" value="0" />
</properties>
</rule>
<rule ref="Zend.Files.ClosingTag" />
</ruleset>