Skip to content

Commit 87e64e1

Browse files
authored
fix: not initialized params in PhpDocResourceMetadataCollectionFactory (#5247)
1 parent 8744857 commit 87e64e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ public function __construct(private readonly ResourceMetadataCollectionFactoryIn
5656
if (class_exists(DocBlockFactory::class) && !class_exists(PhpDocParser::class)) {
5757
trigger_deprecation('api-platform/core', '3.1', 'Using phpdocumentor/reflection-docblock is deprecated. Require phpstan/phpdoc-parser instead.');
5858
}
59+
$phpDocParser = null;
60+
$lexer = null;
5961
if (class_exists(PhpDocParser::class)) {
60-
$this->phpDocParser = new PhpDocParser(new TypeParser(new ConstExprParser()), new ConstExprParser());
61-
$this->lexer = new Lexer();
62+
$phpDocParser = new PhpDocParser(new TypeParser(new ConstExprParser()), new ConstExprParser());
63+
$lexer = new Lexer();
6264
}
65+
$this->phpDocParser = $phpDocParser;
66+
$this->lexer = $lexer;
6367
}
6468

6569
/**

0 commit comments

Comments
 (0)