Skip to content

Commit 6bc1121

Browse files
fix(metadata): do not fail if phpstan/phpdoc-parser is missing (#7279)
1 parent 871e5d3 commit 6bc1121

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,17 @@ 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) {
132136
return null;
133137
}
134138

135139
$rawDocNode = $reflectionClass->getDocComment();
136-
137140
if (!$rawDocNode) {
138141
return null;
139142
}

src/Metadata/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"psr/log": "^1.0 || ^2.0 || ^3.0",
3434
"symfony/property-info": "^6.4 || ^7.1",
3535
"symfony/string": "^6.4 || ^7.0",
36-
"symfony/type-info": "^7.2"
36+
"symfony/type-info": "^7.3"
3737
},
3838
"require-dev": {
3939
"api-platform/json-schema": "^4.1.11",

0 commit comments

Comments
 (0)