Skip to content

Commit 8c25d39

Browse files
[PropertyInfo] Throw when phpdocumentor/reflection-docblock v6 is in use (branch 6.4 only)
1 parent 23950d1 commit 8c25d39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Extractor/PhpDocExtractor.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\PropertyInfo\Extractor;
1313

1414
use phpDocumentor\Reflection\DocBlock;
15+
use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod;
16+
use phpDocumentor\Reflection\DocBlock\Tags\Generic;
1517
use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
1618
use phpDocumentor\Reflection\DocBlockFactory;
1719
use phpDocumentor\Reflection\DocBlockFactoryInterface;
@@ -63,6 +65,10 @@ public function __construct(?DocBlockFactoryInterface $docBlockFactory = null, ?
6365
throw new \LogicException(\sprintf('Unable to use the "%s" class as the "phpdocumentor/reflection-docblock" package is not installed. Try running composer require "phpdocumentor/reflection-docblock".', __CLASS__));
6466
}
6567

68+
if (!is_subclass_of(Generic::class, StaticMethod::class)) {
69+
throw new \LogicException('symfony/property-info v6 does not support phpdocumentor/reflection-docblock v6. Please stick to ^5.2 in your composer.json file.');
70+
}
71+
6672
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
6773
$this->contextFactory = new ContextFactory();
6874
$this->phpDocTypeHelper = new PhpDocTypeHelper();

0 commit comments

Comments
 (0)