Skip to content

Commit 971356b

Browse files
committed
add scalar types condition
1 parent 03c4cbd commit 971356b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

rules/TypeDeclaration/Rector/ClassMethod/KnownMagicClassMethodTypeRector.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use PhpParser\Node\Stmt\Class_;
1111
use Rector\Rector\AbstractRector;
1212
use Rector\ValueObject\MethodName;
13+
use Rector\ValueObject\PhpVersionFeature;
14+
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
1315
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1416
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1517

@@ -18,7 +20,7 @@
1820
*
1921
* @see https://www.php.net/manual/en/language.oop5.overloading.php#object.call
2022
*/
21-
final class KnownMagicClassMethodTypeRector extends AbstractRector
23+
final class KnownMagicClassMethodTypeRector extends AbstractRector implements MinPhpVersionInterface
2224
{
2325
public function getRuleDefinition(): RuleDefinition
2426
{
@@ -89,4 +91,9 @@ public function refactor(Node $node): ?Node
8991

9092
return null;
9193
}
94+
95+
public function provideMinPhpVersion(): int
96+
{
97+
return PhpVersionFeature::SCALAR_TYPES;
98+
}
9299
}

0 commit comments

Comments
 (0)