Skip to content

Commit

Permalink
remove isStaticType() method, already switched to type
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Oct 7, 2021
1 parent 37d1c2d commit 96a5683
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions packages/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
use PHPStan\Type\TypeWithClassName;
use PHPStan\Type\UnionType;
use Rector\Core\Configuration\RenamedClassesDataCollector;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\NodeAnalyzer\ClassAnalyzer;
use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
use Rector\NodeTypeResolver\Node\AttributeKey;
Expand Down Expand Up @@ -268,26 +267,6 @@ public function isNumberType(Node $node): bool
return $nodeType instanceof FloatType;
}

/**
* @deprecated
* Use @see NodeTypeResolver::resolve() instead and instanceof directly
*
* @param class-string<Type> $staticTypeClass
*/
public function isStaticType(Node $node, string $staticTypeClass): bool
{
if (! is_a($staticTypeClass, Type::class, true)) {
throw new ShouldNotHappenException(sprintf(
'"%s" in "%s()" must be type of "%s"',
$staticTypeClass,
__METHOD__,
Type::class
));
}

return is_a($this->getType($node), $staticTypeClass);
}

/**
* @param class-string<Type> $desiredType
*/
Expand Down

0 comments on commit 96a5683

Please sign in to comment.