diff --git a/src/Rector/ToNativeRector.php b/src/Rector/ToNativeRector.php index 6c19524..941fe0e 100644 --- a/src/Rector/ToNativeRector.php +++ b/src/Rector/ToNativeRector.php @@ -4,6 +4,7 @@ use Illuminate\Support\Arr; use PhpParser\Node; +use PHPStan\Type\NeverType; use PHPStan\Type\ObjectType; use Rector\Contract\Rector\ConfigurableRectorInterface; use Rector\PhpParser\Node\Value\ValueResolver; @@ -36,6 +37,10 @@ public function configure(array $configuration): void protected function inConfiguredClasses(Node $node): bool { + if ($this->getType($node) instanceof NeverType) { + return false; + } + foreach ($this->classes as $class) { if ($this->isObjectType($node, $class)) { return true;