Skip to content

Commit

Permalink
this type check
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jul 27, 2022
1 parent 07a769f commit 6d74751
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Reflection/ReflectionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use PHPStan\Reflection\Php\PhpPropertyReflection;
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 Down Expand Up @@ -93,11 +93,11 @@ public function resolveClassReflectionSourceObject(
? $this->nodeTypeResolver->getType($node->var)
: $this->nodeTypeResolver->getType($node->class);

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

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

0 comments on commit 6d74751

Please sign in to comment.