Skip to content

Commit 8a7cf7a

Browse files
committed
Nuke OriginalPropertyTypeExpr
1 parent 0b925a9 commit 8a7cf7a

File tree

4 files changed

+2
-61
lines changed

4 files changed

+2
-61
lines changed

src/Analyser/MutatingScope.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
use PHPStan\Node\Expr\GetIterableKeyTypeExpr;
3535
use PHPStan\Node\Expr\GetIterableValueTypeExpr;
3636
use PHPStan\Node\Expr\GetOffsetValueTypeExpr;
37-
use PHPStan\Node\Expr\OriginalPropertyTypeExpr;
3837
use PHPStan\Node\Expr\ParameterVariableOriginalValueExpr;
3938
use PHPStan\Node\Expr\PropertyInitializationExpr;
4039
use PHPStan\Node\Expr\SetExistingOffsetValueTypeExpr;
@@ -689,15 +688,6 @@ public function getType(Expr $node): Type
689688
return $node->getExprType();
690689
}
691690

692-
if ($node instanceof OriginalPropertyTypeExpr) {
693-
$propertyReflection = $this->propertyReflectionFinder->findPropertyReflectionFromNode($node->getPropertyFetch(), $this);
694-
if ($propertyReflection === null) {
695-
return new ErrorType();
696-
}
697-
698-
return $propertyReflection->getReadableType();
699-
}
700-
701691
$key = $this->getNodeKey($node);
702692

703693
if (!array_key_exists($key, $this->resolvedTypes)) {

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
use PHPStan\Node\Expr\GetIterableKeyTypeExpr;
8585
use PHPStan\Node\Expr\GetIterableValueTypeExpr;
8686
use PHPStan\Node\Expr\GetOffsetValueTypeExpr;
87-
use PHPStan\Node\Expr\OriginalPropertyTypeExpr;
8887
use PHPStan\Node\Expr\PropertyInitializationExpr;
8988
use PHPStan\Node\Expr\SetExistingOffsetValueTypeExpr;
9089
use PHPStan\Node\Expr\SetOffsetValueTypeExpr;
@@ -5022,12 +5021,8 @@ private function processAssignVar(
50225021
$originalVar = $var;
50235022
$assignedPropertyExpr = $assignedExpr;
50245023
while ($var instanceof ArrayDimFetch) {
5025-
$varForSetOffsetValue = $var->var;
5026-
if ($varForSetOffsetValue instanceof PropertyFetch || $varForSetOffsetValue instanceof StaticPropertyFetch) {
5027-
$varForSetOffsetValue = new OriginalPropertyTypeExpr($varForSetOffsetValue);
5028-
}
50295024
$assignedPropertyExpr = new SetOffsetValueTypeExpr(
5030-
$varForSetOffsetValue,
5025+
$var->var,
50315026
$var->dim,
50325027
$assignedPropertyExpr,
50335028
);
@@ -5342,12 +5337,8 @@ static function (): void {
53425337
$dimFetchStack = [];
53435338
$assignedPropertyExpr = $assignedExpr;
53445339
while ($var instanceof ExistingArrayDimFetch) {
5345-
$varForSetOffsetValue = $var->getVar();
5346-
if ($varForSetOffsetValue instanceof PropertyFetch || $varForSetOffsetValue instanceof StaticPropertyFetch) {
5347-
$varForSetOffsetValue = new OriginalPropertyTypeExpr($varForSetOffsetValue);
5348-
}
53495340
$assignedPropertyExpr = new SetExistingOffsetValueTypeExpr(
5350-
$varForSetOffsetValue,
5341+
$var->getVar(),
53515342
$var->getDim(),
53525343
$assignedPropertyExpr,
53535344
);

src/Node/Expr/OriginalPropertyTypeExpr.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Node/Printer/Printer.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use PHPStan\Node\Expr\GetIterableKeyTypeExpr;
99
use PHPStan\Node\Expr\GetIterableValueTypeExpr;
1010
use PHPStan\Node\Expr\GetOffsetValueTypeExpr;
11-
use PHPStan\Node\Expr\OriginalPropertyTypeExpr;
1211
use PHPStan\Node\Expr\ParameterVariableOriginalValueExpr;
1312
use PHPStan\Node\Expr\PropertyInitializationExpr;
1413
use PHPStan\Node\Expr\SetExistingOffsetValueTypeExpr;
@@ -57,11 +56,6 @@ protected function pPHPStan_Node_ExistingArrayDimFetch(ExistingArrayDimFetch $ex
5756
return sprintf('__phpstanExistingArrayDimFetch(%s, %s)', $this->p($expr->getVar()), $this->p($expr->getDim()));
5857
}
5958

60-
protected function pPHPStan_Node_OriginalPropertyTypeExpr(OriginalPropertyTypeExpr $expr): string // phpcs:ignore
61-
{
62-
return sprintf('__phpstanOriginalPropertyType(%s)', $this->p($expr->getPropertyFetch()));
63-
}
64-
6559
protected function pPHPStan_Node_SetOffsetValueTypeExpr(SetOffsetValueTypeExpr $expr): string // phpcs:ignore
6660
{
6761
return sprintf('__phpstanSetOffsetValueType(%s, %s, %s)', $this->p($expr->getVar()), $expr->getDim() !== null ? $this->p($expr->getDim()) : 'null', $this->p($expr->getValue()));

0 commit comments

Comments
 (0)