Skip to content

Commit 531ce02

Browse files
authored
[CodeQuality] Skip compare NeverType on AssertEqualsToSameRector (#434)
1 parent 674248c commit 531ce02

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rules/CodeQuality/Rector/MethodCall/AssertEqualsToSameRector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use PHPStan\Type\FloatType;
1717
use PHPStan\Type\IntegerType;
1818
use PHPStan\Type\MixedType;
19+
use PHPStan\Type\NeverType;
1920
use PHPStan\Type\ObjectType;
2021
use PHPStan\Type\StringType;
2122
use PHPStan\Type\Type;
@@ -126,6 +127,11 @@ public function refactor(Node $node): ?Node
126127
if ($secondArgType instanceof MixedType) {
127128
return null;
128129
}
130+
131+
// can happen with magic process
132+
if ($secondArgType instanceof NeverType) {
133+
return null;
134+
}
129135
}
130136

131137
$hasChanged = $this->identifierManipulator->renameNodeWithMap($node, self::RENAME_METHODS_MAP);

0 commit comments

Comments
 (0)