Skip to content

Commit

Permalink
phpcs: emulate lowest supported php version (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored Dec 28, 2023
1 parent bbfa955 commit 81b184a
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<file>tests/</file>

<config name="installed_paths" value="../../slevomat/coding-standard"/>
<config name="php_version" value="70200"/>

<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
Expand Down Expand Up @@ -245,9 +246,7 @@
</rule>

<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference">
<exclude name="SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall"/> <!-- after bumping to PHP8 -->
</rule>
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
<properties>
Expand Down Expand Up @@ -303,10 +302,8 @@
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/>
<rule ref="SlevomatCodingStandard.Functions.DisallowArrowFunction"/>
<rule ref="SlevomatCodingStandard.Functions.DisallowNamedArguments"/>
<!-- after bumping PHP version
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
-->
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
Expand Down Expand Up @@ -346,7 +343,7 @@
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.PartialUse"/>
<!-- rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator" Since PHP 7.4-->
<rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/>
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing" />
<rule ref="SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall" />
Expand All @@ -365,19 +362,15 @@
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" />
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
<!-- after bumping php version to 7.4
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<properties>
<property name="enableNativeTypeHint" value="true"/>
<property name="traversableTypeHints" type="array" value="
Generator,
Traversable,
Doctrine\Common\Collections\Collection
"/>
</properties>
</rule>
-->

<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<properties>
<property name="traversableTypeHints" type="array" value="
Expand All @@ -397,12 +390,6 @@
Traversable,
Doctrine\Common\Collections\Collection
"/>
<property name="enableMixedTypeHint" value="false"/> <!-- requires PHP 8.0 -->
<property name="enableStaticTypeHint" value="false"/> <!-- requires PHP 8.0 -->
<property name="enableUnionTypeHint" value="false"/> <!-- requires PHP 8.0 -->
<property name="enableIntersectionTypeHint" value="false"/> <!-- requires PHP 8.1 -->
<property name="enableNeverTypeHint" value="false"/> <!-- requires PHP 8.1 -->
<property name="enableStandaloneNullTrueFalseTypeHints" value="false"/> <!-- requires PHP 8.2 -->
</properties>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/><!-- this has problems with vendor libs, PHPStan checks this much more reliably -->
</rule>
Expand Down

0 comments on commit 81b184a

Please sign in to comment.