8000 minor #17932 [PropertyInfo] Allow to use a custom DocBlock factory wi… · symfony/symfony@2544162 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2544162

Browse files
committed
minor #17932 [PropertyInfo] Allow to use a custom DocBlock factory with the PHPDoc extractor (dunglas)
This PR was merged into the 3.1-dev branch. Discussion ---------- [PropertyInfo] Allow to use a custom DocBlock factory with the PHPDoc extractor | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | yes | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Minor tweak to #17531. Commits ------- 3c32a2f [PropertyInfo] Allow to use a custom DocBlock factory with the PHPDoc extractor
2 parents 48f05ec + 3c32a2f commit 2544162

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)
0