Skip to content

Commit 3103b88

Browse files
staabmondrejmirtes
authored andcommitted
VoidToNullTraverser: Intersections cannot contain void
see #4835
1 parent 43d5026 commit 3103b88

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Analyser/Traverser/VoidToNullTraverser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPStan\Analyser\Traverser;
44

5-
use PHPStan\Type\IntersectionType;
65
use PHPStan\Type\NullType;
76
use PHPStan\Type\Type;
87
use PHPStan\Type\TypeTraverserCallable;
@@ -16,7 +15,7 @@ final class VoidToNullTraverser implements TypeTraverserCallable
1615
*/
1716
public function traverse(Type $type, callable $traverse): Type
1817
{
19-
if ($type instanceof UnionType || $type instanceof IntersectionType) {
18+
if ($type instanceof UnionType) {
2019
return $traverse($type);
2120
}
2221

0 commit comments

Comments
 (0)