Skip to content

Commit 81b184a

Browse files
authored
phpcs: emulate lowest supported php version (#16)
1 parent bbfa955 commit 81b184a

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

phpcs.xml.dist

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<file>tests/</file>
2020

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

2324
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
2425
<rule ref="Generic.Classes.DuplicateClassName"/>
@@ -245,9 +246,7 @@
245246
</rule>
246247

247248
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
248-
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference">
249-
<exclude name="SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall"/> <!-- after bumping to PHP8 -->
250-
</rule>
249+
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
251250
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
252251
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
253252
<properties>
@@ -303,10 +302,8 @@
303302
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/>
304303
<rule ref="SlevomatCodingStandard.Functions.DisallowArrowFunction"/>
305304
<rule ref="SlevomatCodingStandard.Functions.DisallowNamedArguments"/>
306-
<!-- after bumping PHP version
307305
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
308306
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
309-
-->
310307
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
311308
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
312309
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
@@ -346,7 +343,7 @@
346343
</properties>
347344
</rule>
348345
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.PartialUse"/>
349-
<!-- rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator" Since PHP 7.4-->
346+
<rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/>
350347
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
351348
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing" />
352349
<rule ref="SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall" />
@@ -365,19 +362,15 @@
365362
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
366363
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" />
367364
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
368-
<!-- after bumping php version to 7.4
369365
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
370366
<properties>
371-
<property name="enableNativeTypeHint" value="true"/>
372367
<property name="traversableTypeHints" type="array" value="
373368
Generator,
374369
Traversable,
375370
Doctrine\Common\Collections\Collection
376371
"/>
377372
</properties>
378373
</rule>
379-
-->
380-
381374
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
382375
<properties>
383376
<property name="traversableTypeHints" type="array" value="
@@ -397,12 +390,6 @@
397390
Traversable,
398391
Doctrine\Common\Collections\Collection
399392
"/>
400-
<property name="enableMixedTypeHint" value="false"/> <!-- requires PHP 8.0 -->
401-
<property name="enableStaticTypeHint" value="false"/> <!-- requires PHP 8.0 -->
402-
<property name="enableUnionTypeHint" value="false"/> <!-- requires PHP 8.0 -->
403-
<property name="enableIntersectionTypeHint" value="false"/> <!-- requires PHP 8.1 -->
404-
<property name="enableNeverTypeHint" value="false"/> <!-- requires PHP 8.1 -->
405-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false"/> <!-- requires PHP 8.2 -->
406393
</properties>
407394
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/><!-- this has problems with vendor libs, PHPStan checks this much more reliably -->
408395
</rule>

0 commit comments

Comments
 (0)