Skip to content

Commit 8e6f0bf

Browse files
fix: earlier return
1 parent c44438b commit 8e6f0bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ private function getDocBlock(string $class): ?PhpDocNode
126126
return $this->docBlocks[$class];
127127
}
128128

129+
if (!$this->phpDocParser || !$this->lexer) {
130+
return null;
131+
}
132+
129133
try {
130134
$reflectionClass = new \ReflectionClass($class);
131135
} catch (\ReflectionException) {
@@ -137,10 +141,6 @@ private function getDocBlock(string $class): ?PhpDocNode
137141
return null;
138142
}
139143

140-
if (!$this->phpDocParser || !$this->lexer) {
141-
return null;
142-
}
143-
144144
$tokens = new TokenIterator($this->lexer->tokenize($rawDocNode));
145145
$phpDocNode = $this->phpDocParser->parse($tokens);
146146
$tokens->consumeTokenType(Lexer::TOKEN_END);

0 commit comments

Comments
 (0)