Skip to content

Commit dac05e6

Browse files
committed
add scalar types condition
1 parent a3d2df1 commit dac05e6

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

rules/TypeDeclaration/Rector/ClassMethod/KnownMagicClassMethodTypeRector.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
use PhpParser\Node\Stmt\Class_;
1111
use Rector\Rector\AbstractRector;
1212
use Rector\ValueObject\MethodName;
13+
<<<<<<< HEAD
1314
use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard;
15+
=======
16+
use Rector\ValueObject\PhpVersionFeature;
17+
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
18+
>>>>>>> 971356b355 (add scalar types condition)
1419
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1520
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1621

@@ -19,7 +24,7 @@
1924
*
2025
* @see https://www.php.net/manual/en/language.oop5.overloading.php#object.call
2126
*/
22-
final class KnownMagicClassMethodTypeRector extends AbstractRector
27+
final class KnownMagicClassMethodTypeRector extends AbstractRector implements MinPhpVersionInterface
2328
{
2429
public function __construct(
2530
private readonly ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard
@@ -100,4 +105,9 @@ public function refactor(Node $node): ?Node
100105

101106
return null;
102107
}
108+
109+
public function provideMinPhpVersion(): int
110+
{
111+
return PhpVersionFeature::SCALAR_TYPES;
112+
}
103113
}

0 commit comments

Comments
 (0)