Add implements

This commit is contained in:
AhJ
2024-07-16 21:19:04 +03:30
parent aa53f8d437
commit bbb6a02b91
3 changed files with 102 additions and 1 deletions
+4 -1
View File
@@ -28,6 +28,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Factory\PropertyReadFactory;
use phpDocumentor\Reflection\DocBlock\Tags\Factory\PropertyWriteFactory;
use phpDocumentor\Reflection\DocBlock\Tags\Factory\ReturnFactory;
use phpDocumentor\Reflection\DocBlock\Tags\Factory\VarFactory;
use phpDocumentor\Reflection\DocBlock\Tags\Factory\ImplementsFactory;
use Webmozart\Assert\Assert;
use function array_shift;
@@ -76,7 +77,8 @@ final class DocBlockFactory implements DocBlockFactoryInterface
new PropertyFactory($typeResolver, $descriptionFactory),
new PropertyReadFactory($typeResolver, $descriptionFactory),
new PropertyWriteFactory($typeResolver, $descriptionFactory),
new MethodFactory($typeResolver, $descriptionFactory)
new MethodFactory($typeResolver, $descriptionFactory),
new ImplementsFactory($typeResolver, $descriptionFactory)
);
$tagFactory->addService($descriptionFactory);
@@ -88,6 +90,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface
$tagFactory->registerTagHandler('property-read', $phpstanTagFactory);
$tagFactory->registerTagHandler('property-write', $phpstanTagFactory);
$tagFactory->registerTagHandler('method', $phpstanTagFactory);
$tagFactory->registerTagHandler('implements', $phpstanTagFactory);
$docBlockFactory = new self($descriptionFactory, $tagFactory);
foreach ($additionalTags as $tagName => $tagHandler) {