Skip to content

Commit

Permalink
修复测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Apr 18, 2024
1 parent 721f718 commit 91863b4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Util/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@

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;

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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 91863b4

Please sign in to comment.