Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jul 27, 2022
1 parent ed258de commit a8c0025
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Reflection/ReflectionResolver.php
Expand Up @@ -23,7 +23,6 @@
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Type\TypeUtils;
use PHPStan\Type\TypeWithClassName;
use PHPStan\Type\ThisType;
use Rector\Core\NodeAnalyzer\ClassAnalyzer;
use Rector\Core\PhpParser\AstResolver;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
Expand All @@ -32,7 +31,6 @@
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\NodeTypeResolver;
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
use Symfony\Contracts\Service\Attribute\Required;

final class ReflectionResolver
Expand Down Expand Up @@ -94,11 +92,10 @@ public function resolveClassReflectionSourceObject(
? $this->nodeTypeResolver->getType($node->var)
: $this->nodeTypeResolver->getType($node->class);

if (! in_array($objectType::class, [ThisType::class, FullyQualifiedObjectType::class], true)) {
if (! $objectType instanceof TypeWithClassName) {
return null;
}

/** @var ThisType|FullyQualifiedObjectType $objectType */
$className = $objectType->getClassName();
if (! $this->reflectionProvider->hasClass($className)) {
return null;
Expand Down

0 comments on commit a8c0025

Please sign in to comment.