throw exception if docblock factory does not exist
This commit is contained in:
parent
2610da7d9e
commit
5cfceed460
@ -53,6 +53,10 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
|
|||||||
*/
|
*/
|
||||||
public function __construct(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null)
|
public function __construct(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null)
|
||||||
{
|
{
|
||||||
|
if (!class_exists(DocBlockFactory::class)) {
|
||||||
|
throw new \RuntimeException(sprintf('Unable to use the "%s" class as the "phpdocumentor/reflection-docblock" package is not installed.', __CLASS__));
|
||||||
|
}
|
||||||
|
|
||||||
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
|
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
|
||||||
$this->contextFactory = new ContextFactory();
|
$this->contextFactory = new ContextFactory();
|
||||||
$this->phpDocTypeHelper = new PhpDocTypeHelper();
|
$this->phpDocTypeHelper = new PhpDocTypeHelper();
|
||||||
|
Reference in New Issue
Block a user