Skip to content

Commit 204a282

Browse files
committed
Handle NeverType
#355
1 parent 00217d6 commit 204a282

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Rector/ToNativeRector.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Arr;
66
use PhpParser\Node;
7+
use PHPStan\Type\NeverType;
78
use PHPStan\Type\ObjectType;
89
use Rector\Contract\Rector\ConfigurableRectorInterface;
910
use Rector\PhpParser\Node\Value\ValueResolver;
@@ -36,6 +37,10 @@ public function configure(array $configuration): void
3637

3738
protected function inConfiguredClasses(Node $node): bool
3839
{
40+
if ($this->getType($node) instanceof NeverType) {
41+
return false;
42+
}
43+
3944
foreach ($this->classes as $class) {
4045
if ($this->isObjectType($node, $class)) {
4146
return true;

0 commit comments

Comments
 (0)