Skip to content

Commit

Permalink
Remove PropertyFetchTypeAnalyzer and it's usages (#3410)
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-bos committed Feb 24, 2023
1 parent 9c7da41 commit 2cca234
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 81 deletions.
63 changes: 0 additions & 63 deletions rules/TypeDeclaration/TypeAnalyzer/PropertyFetchTypeAnalyzer.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Rector\TypeDeclaration\AlreadyAssignDetector\NullTypeAssignDetector;
use Rector\TypeDeclaration\AlreadyAssignDetector\PropertyDefaultAssignDetector;
use Rector\TypeDeclaration\Matcher\PropertyAssignMatcher;
use Rector\TypeDeclaration\TypeAnalyzer\PropertyFetchTypeAnalyzer;

/**
* @deprecated
Expand All @@ -47,7 +46,6 @@ public function __construct(
private readonly ExprAnalyzer $exprAnalyzer,
private readonly ValueResolver $valueResolver,
private readonly PropertyFetchAnalyzer $propertyFetchAnalyzer,
private readonly PropertyFetchTypeAnalyzer $propertyFetchTypeAnalyzer,
) {
}

Expand Down Expand Up @@ -200,12 +198,6 @@ private function getAssignedExprTypes(ClassLike $classLike, string $propertyName
return null;
}

if ($this->propertyFetchAnalyzer->isPropertyFetch($node->expr)
&& $this->propertyFetchTypeAnalyzer->isPropertyFetchExprNotNativelyTyped($node->expr)
) {
return null;
}

if ($this->exprAnalyzer->isNonTypedFromParam($node->expr)) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use PHPStan\Type\TypeCombinator;
use PHPStan\Type\UnionType;
use Rector\Core\NodeAnalyzer\ParamAnalyzer;
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
use Rector\Core\NodeManipulator\ClassMethodPropertyFetchManipulator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\NodeNameResolver\NodeNameResolver;
Expand All @@ -35,7 +34,6 @@
use Rector\StaticTypeMapper\StaticTypeMapper;
use Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType;
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
use Rector\TypeDeclaration\TypeAnalyzer\PropertyFetchTypeAnalyzer;
use Rector\TypeDeclaration\TypeInferer\AssignToPropertyTypeInferer;

/**
Expand All @@ -56,8 +54,6 @@ public function __construct(
private readonly ParamAnalyzer $paramAnalyzer,
private readonly AssignToPropertyTypeInferer $assignToPropertyTypeInferer,
private readonly TypeComparator $typeComparator,
private readonly PropertyFetchAnalyzer $propertyFetchAnalyzer,
private readonly PropertyFetchTypeAnalyzer $propertyFetchTypeAnalyzer,
) {
}

Expand Down Expand Up @@ -85,12 +81,6 @@ public function inferProperty(Property $property, ClassMethod $classMethod): Typ

$resolvedTypes = [];
foreach ($assignedExprs as $assignedExpr) {
if ($this->propertyFetchAnalyzer->isPropertyFetch($assignedExpr)
&& $this->propertyFetchTypeAnalyzer->isPropertyFetchExprNotNativelyTyped($assignedExpr)
) {
continue;
}

$resolvedTypes[] = $this->nodeTypeResolver->getType($assignedExpr);
}

Expand Down

0 comments on commit 2cca234

Please sign in to comment.