diff --git a/src/Util/DocBlock.php b/src/Util/DocBlock.php index 5c5d29c37..295190c9c 100644 --- a/src/Util/DocBlock.php +++ b/src/Util/DocBlock.php @@ -4,8 +4,8 @@ namespace Imi\Util; +use phpDocumentor\Reflection\DocBlock as RealDocBlock; use phpDocumentor\Reflection\DocBlockFactory; -use phpDocumentor\Reflection\DocBlockFactoryInterface; use phpDocumentor\Reflection\Location; use phpDocumentor\Reflection\Types\Context; @@ -13,13 +13,14 @@ class DocBlock { use \Imi\Util\Traits\TStaticClass; - private static ?DocBlockFactoryInterface $factory = null; + private static ?DocBlockFactory $factory = null; - public static function getFactory(): DocBlockFactoryInterface + public static function getFactory(): DocBlockFactory { if (null === self::$factory) { - self::$factory = DocBlockFactory::createInstance(); + // @phpstan-ignore-next-line + return self::$factory = DocBlockFactory::createInstance(); } return self::$factory; @@ -28,7 +29,7 @@ public static function getFactory(): DocBlockFactoryInterface /** * @param object|string $docblock a string containing the DocBlock to parse or an object supporting the getDocComment method (such as a ReflectionClass object) */ - public static function getDocBlock($docblock, ?Context $context = null, ?Location $location = null): DocBlockFactoryInterface + public static function getDocBlock($docblock, ?Context $context = null, ?Location $location = null): RealDocBlock { return self::getFactory()->create($docblock, $context, $location); }