File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ final class TypeTraverserInstanceofVisitor extends NodeVisitorAbstract
1313
1414 public const ATTRIBUTE_NAME = 'insideTypeTraverserMap ' ;
1515
16+ private const TYPE_TRAVERSER_CLASSES = [
17+ 'phpstan \\type \\typetraverser ' ,
18+ 'phpstan \\type \\simultaneoustypetraverser ' ,
19+ ];
20+
1621 private int $ depth = 0 ;
1722
1823 #[Override]
@@ -33,7 +38,7 @@ public function enterNode(Node $node): ?Node
3338 if (
3439 $ node instanceof Node \Expr \StaticCall
3540 && $ node ->class instanceof Node \Name
36- && $ node ->class ->toLowerString () === ' phpstan \\ type \\ typetraverser '
41+ && \in_array ( $ node ->class ->toLowerString (), self :: TYPE_TRAVERSER_CLASSES , true )
3742 && $ node ->name instanceof Node \Identifier
3843 && $ node ->name ->toLowerString () === 'map '
3944 ) {
@@ -49,7 +54,7 @@ public function leaveNode(Node $node): ?Node
4954 if (
5055 $ node instanceof Node \Expr \StaticCall
5156 && $ node ->class instanceof Node \Name
52- && $ node ->class ->toLowerString () === ' phpstan \\ type \\ typetraverser '
57+ && \in_array ( $ node ->class ->toLowerString (), self :: TYPE_TRAVERSER_CLASSES , true )
5358 && $ node ->name instanceof Node \Identifier
5459 && $ node ->name ->toLowerString () === 'map '
5560 ) {
You can’t perform that action at this time.
0 commit comments