Skip to content

Commit c5f2942

Browse files
bug #26265 [PropertyInfo] throw exception if docblock factory does not exist (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [PropertyInfo] throw exception if docblock factory does not exist | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26259 | License | MIT | Doc PR | Commits ------- 5cfceed throw exception if docblock factory does not exist
2 parents 4334459 + 5cfceed commit c5f2942

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
5353
*/
5454
public function __construct(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null)
5555
{
56+
if (!class_exists(DocBlockFactory::class)) {
57+
throw new \RuntimeException(sprintf('Unable to use the "%s" class as the "phpdocumentor/reflection-docblock" package is not installed.', __CLASS__));
58+
}
59+
5660
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
5761
$this->contextFactory = new ContextFactory();
5862
$this->phpDocTypeHelper = new PhpDocTypeHelper();

0 commit comments

Comments
 (0)