Skip to content

Commit

Permalink
Mark DeprecatedHelper::isDeprecated() as pure
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Oct 13, 2021
1 parent 2a809e7 commit 9221c32
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Reflection/Deprecated/DeprecatedHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ final class DeprecatedHelper
{
private static ?DocBlockFactory $docBlockFactory = null;

/**
* @psalm-pure
*/
public static function isDeprecated(string $docComment): bool
{
if ($docComment === '') {
return false;
}

/** @psalm-suppress ImpureStaticProperty, ImpureMethodCall */
self::$docBlockFactory ??= DocBlockFactory::createInstance();

$docBlock = self::$docBlockFactory->create($docComment);

return $docBlock->hasTag('deprecated');
/** @psalm-suppress ImpureStaticProperty, ImpureMethodCall */
return self::$docBlockFactory->create($docComment)->hasTag('deprecated');
}
}

0 comments on commit 9221c32

Please sign in to comment.