|
29 | 29 | use PHPStan\Analyser\Generator\GeneratorScope; |
30 | 30 | use PHPStan\Analyser\Generator\InternalThrowPoint; |
31 | 31 | use PHPStan\Analyser\Generator\NodeCallbackRequest; |
| 32 | +use PHPStan\Analyser\Generator\NoopNodeCallback; |
32 | 33 | use PHPStan\Analyser\Generator\TypeExprRequest; |
33 | 34 | use PHPStan\Analyser\Generator\TypeExprResult; |
34 | 35 | use PHPStan\Analyser\ImpurePoint; |
@@ -338,9 +339,7 @@ private function processStmtVarAnnotation(GeneratorScope $scope, Node\Stmt $stmt |
338 | 339 | yield new NodeCallbackRequest(new VarTagChangedExpressionTypeNode($varTag, $variableNode), $scope); |
339 | 340 | } |
340 | 341 |
|
341 | | - // todo NoopExprAnalysisRequest |
342 | | - $variableNodeResult = yield new ExprAnalysisRequest($stmt, $variableNode, $scope, ExpressionContext::createDeep(), static function () { |
343 | | - }); |
| 342 | + $variableNodeResult = yield new ExprAnalysisRequest($stmt, $variableNode, $scope, ExpressionContext::createDeep(), new NoopNodeCallback()); |
344 | 343 |
|
345 | 344 | $assignVarGen = $scope->assignVariable( |
346 | 345 | $name, |
@@ -640,14 +639,12 @@ private function processAssignVar( |
640 | 639 | } |
641 | 640 |
|
642 | 641 | if (!$varType->isArray()->yes() && !(new ObjectType(ArrayAccess::class))->isSuperTypeOf($varType)->no()) { |
643 | | - // todo NoopExprAnalysisRequest |
644 | 642 | $throwPoints = array_merge($throwPoints, (yield new ExprAnalysisRequest( |
645 | 643 | $stmt, |
646 | 644 | new MethodCall($var, 'offsetSet'), |
647 | 645 | $scope, |
648 | 646 | $context, |
649 | | - static function (): void { |
650 | | - }, |
| 647 | + new NoopNodeCallback(), |
651 | 648 | ))->throwPoints); |
652 | 649 | } |
653 | 650 |
|
@@ -758,14 +755,12 @@ static function (): void { |
758 | 755 | $scope = $assignExprGen->getReturn(); |
759 | 756 | // simulate dynamic property assign by __set to get throw points |
760 | 757 | if (!$propertyHolderType->hasMethod('__set')->no()) { |
761 | | - // todo NoopExprAnalysisRequest |
762 | 758 | $throwPoints = array_merge($throwPoints, (yield new ExprAnalysisRequest( |
763 | 759 | $stmt, |
764 | 760 | new MethodCall($var->var, '__set'), |
765 | 761 | $scope, |
766 | 762 | $context, |
767 | | - static function (): void { |
768 | | - }, |
| 763 | + new NoopNodeCallback(), |
769 | 764 | ))->throwPoints); |
770 | 765 | } |
771 | 766 | } |
@@ -975,8 +970,7 @@ static function (GeneratorScope $scope): Generator { |
975 | 970 | } |
976 | 971 |
|
977 | 972 | // 1. eval root expr |
978 | | - $varResult = yield new ExprAnalysisRequest($stmt, $var, $scope, $context->enterDeep(), static function () { |
979 | | - }); // todo Noop... |
| 973 | + $varResult = yield new ExprAnalysisRequest($stmt, $var, $scope, $context->enterDeep(), new NoopNodeCallback()); |
980 | 974 | $hasYield = $varResult->hasYield; |
981 | 975 | $throwPoints = $varResult->throwPoints; |
982 | 976 | $impurePoints = $varResult->impurePoints; |
|
0 commit comments