Skip to content

Commit fc01280

Browse files
committed
Revert "Fix phpstan/phpstan#7088: Accessing SimpleXMLElement nodes using braces gives mixed type (#5406)"
This reverts commit 85b4f24.
1 parent 9f06b58 commit fc01280

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/Analyser/ExprHandler/PropertyFetchHandler.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@
3333
final class PropertyFetchHandler implements ExprHandler
3434
{
3535

36-
/**
37-
* Representative property name used when resolving dynamic property access ($obj->{$expr}).
38-
* The actual name doesn't matter — it just needs to be non-empty so that
39-
* PropertiesClassReflectionExtensions (e.g. SimpleXMLElement) that accept
40-
* any property name can return the correct type.
41-
*/
42-
private const DYNAMIC_PROPERTY_NAME = '__phpstan_dynamic_property';
43-
4436
public function __construct(
4537
private PhpVersion $phpVersion,
4638
private PropertyReflectionFinder $propertyReflectionFinder,
@@ -138,14 +130,6 @@ public function resolveType(MutatingScope $scope, Expr $expr): Type
138130
);
139131
}
140132

141-
if ($nameType->isString()->yes()) {
142-
$fetchedOnType = $scope->getType($expr->var);
143-
$returnType = $this->propertyFetchType($scope, $fetchedOnType, self::DYNAMIC_PROPERTY_NAME, $expr);
144-
if ($returnType !== null) {
145-
return NullsafeShortCircuitingHelper::getType($scope, $expr->var, $returnType);
146-
}
147-
}
148-
149133
return new MixedType();
150134
}
151135

tests/PHPStan/Analyser/nsrt/bug-7088.php

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

0 commit comments

Comments
 (0)