Skip to content

Commit

Permalink
Handle NeverType
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Mar 5, 2024
1 parent 00217d6 commit 204a282
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Rector/ToNativeRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 204a282

Please sign in to comment.