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 271e13e commit 5bc3727
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 151 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
2 changes: 1 addition & 1 deletion rules/CodeQuality/Rector/If_/ExplicitBoolCompareRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function resolveNewConditionNode(Expr $expr, bool $isNegated): ?BinaryOp
return $this->resolveFloat($isNegated, $expr);
}

if ($exprType instanceof ObjectType) {
if ($this->nodeTypeResolver->isNullableTypeOfSpecificType($expr, ObjectType::class)) {
return $this->resolveNullable($isNegated, $expr);
}

Expand Down
99 changes: 0 additions & 99 deletions rules/Restoration/Type/ConstantReturnToParamTypeConverter.php

This file was deleted.

30 changes: 0 additions & 30 deletions rules/Restoration/ValueObject/InferParamFromClassMethodReturn.php

This file was deleted.

0 comments on commit 5bc3727

Please sign in to comment.