From 2760cdf44451f52b2c6edf4045ac0559c7d49eea Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Thu, 12 Mar 2026 11:36:19 -0500 Subject: [PATCH] [StrictStringParamConcatRector] Skip PHP version 5.6 or earlier resolves rectorphp/rector#9691 Signed-off-by: Nathanael Esayeas --- .../Rector/ClassMethod/StrictStringParamConcatRector.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php index d83c6be72ef..1f09f021414 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php @@ -23,14 +23,16 @@ use PHPStan\Type\TypeCombinator; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; use Rector\Rector\AbstractRector; +use Rector\ValueObject\PhpVersionFeature; use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard; +use Rector\VersionBonding\Contract\MinPhpVersionInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Tests\TypeDeclaration\Rector\ClassMethod\StrictStringParamConcatRector\StrictStringParamConcatRectorTest */ -final class StrictStringParamConcatRector extends AbstractRector +final class StrictStringParamConcatRector extends AbstractRector implements MinPhpVersionInterface { public function __construct( private readonly ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard, @@ -73,6 +75,11 @@ public function getNodeTypes(): array return [ClassMethod::class, Function_::class, Closure::class]; } + public function provideMinPhpVersion(): int + { + return PhpVersionFeature::SCALAR_TYPES; + } + /** * @param ClassMethod|Function_|Closure $node */