Skip to content

Commit 0071144

Browse files
authored
[StrictStringParamConcatRector] Skip PHP version 5.6 or earlier (#7927)
resolves rectorphp/rector#9691 Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
1 parent 572e318 commit 0071144

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@
2323
use PHPStan\Type\TypeCombinator;
2424
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
2525
use Rector\Rector\AbstractRector;
26+
use Rector\ValueObject\PhpVersionFeature;
2627
use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard;
28+
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
2729
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
2830
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
2931

3032
/**
3133
* @see \Rector\Tests\TypeDeclaration\Rector\ClassMethod\StrictStringParamConcatRector\StrictStringParamConcatRectorTest
3234
*/
33-
final class StrictStringParamConcatRector extends AbstractRector
35+
final class StrictStringParamConcatRector extends AbstractRector implements MinPhpVersionInterface
3436
{
3537
public function __construct(
3638
private readonly ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard,
@@ -73,6 +75,11 @@ public function getNodeTypes(): array
7375
return [ClassMethod::class, Function_::class, Closure::class];
7476
}
7577

78+
public function provideMinPhpVersion(): int
79+
{
80+
return PhpVersionFeature::SCALAR_TYPES;
81+
}
82+
7683
/**
7784
* @param ClassMethod|Function_|Closure $node
7885
*/

0 commit comments

Comments
 (0)