Skip to content

Commit 025ff54

Browse files
committed
hooked can throw
1 parent cdf8b91 commit 025ff54

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5505,11 +5505,6 @@ static function (): void {
55055505
$hasYield = $hasYield || $propertyNameResult->hasYield();
55065506
$throwPoints = array_merge($throwPoints, $propertyNameResult->getThrowPoints());
55075507
$impurePoints = array_merge($impurePoints, $propertyNameResult->getImpurePoints());
5508-
5509-
if ($this->phpVersion->supportsPropertyHooks()) {
5510-
$throwPoints[] = ThrowPoint::createImplicit($scope, $var);
5511-
}
5512-
55135508
$scope = $propertyNameResult->getScope();
55145509
}
55155510

@@ -5519,6 +5514,10 @@ static function (): void {
55195514
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
55205515
$scope = $result->getScope();
55215516

5517+
if ($var->name instanceof Expr && $this->phpVersion->supportsPropertyHooks()) {
5518+
$throwPoints[] = ThrowPoint::createImplicit($scope, $var);
5519+
}
5520+
55225521
$propertyHolderType = $scope->getType($var->var);
55235522
if ($propertyName !== null && $propertyHolderType->hasProperty($propertyName)->yes()) {
55245523
$propertyReflection = $propertyHolderType->getProperty($propertyName, $scope);

0 commit comments

Comments
 (0)