Skip to content

Commit 3c32a2f

Browse files
committed
[PropertyInfo] Allow to use a custom DocBlock factory with the PHPDoc extractor
1 parent 48f05ec commit 3c32a2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use phpDocumentor\Reflection\DocBlock;
1515
use phpDocumentor\Reflection\DocBlockFactory;
16+
use phpDocumentor\Reflection\DocBlockFactoryInterface;
1617
use phpDocumentor\Reflection\Types\Compound;
1718
use phpDocumentor\Reflection\Types\ContextFactory;
1819
use phpDocumentor\Reflection\Types\Null_;
@@ -46,9 +47,9 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
4647
*/
4748
private $contextFactory;
4849

49-
public function __construct()
50+
public function __construct(DocBlockFactoryInterface $docBlockFactory = null)
5051
{
51-
$this->docBlockFactory = DocBlockFactory::createInstance();
52+
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
5253
$this->contextFactory = new ContextFactory();
5354
}
5455

0 commit comments

Comments
 (0)