Skip to content

Commit 06e6422

Browse files
committed
Cleanup
1 parent ea39639 commit 06e6422

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void
6767
continue;
6868
}
6969

70-
/** @var list<UnionTypeNode> $unionTypeNodes */
71-
$unionTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), UnionTypeNode::class);
7270
$arrayTypeNodes = $this->getArrayTypeNodes($annotation->getValue());
7371

7472
foreach ($arrayTypeNodes as $arrayTypeNode) {
@@ -87,6 +85,9 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void
8785

8886
$parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer);
8987

88+
/** @var list<UnionTypeNode> $unionTypeNodes */
89+
$unionTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), UnionTypeNode::class);
90+
9091
$unionTypeNode = $this->findUnionTypeThatContainsArrayType($arrayTypeNode, $unionTypeNodes);
9192

9293
if ($unionTypeNode !== null) {

0 commit comments

Comments
 (0)