mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 20:39:43 +01:00
Check minimum php version before running IsCountableRector and TernaryToSpaceshipRector
This commit is contained in:
parent
5f77059320
commit
9d66c6a45d
@ -52,6 +52,10 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
if (! $this->isAtLeastPhpVersion('7.3')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->dualCheckToAble->processBooleanOr($node, 'Countable', 'is_countable') ?: $node;
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,10 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
if (! $this->isAtLeastPhpVersion('7.0')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->shouldSkip($node)) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user