Skip to content

Commit 5cfceed

Browse files
committed
throw exception if docblock factory does not exist
1 parent 2610da7 commit 5cfceed

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)