Skip to content

Commit 0487f0a

Browse files
phpstan-botclaude
andcommitted
Defer resolveCallUserFuncCalleeReflection until needed, native param type
- Lazy-initialize innerCalleeReflection with ??= so reflection work only runs after the passedByReference()->createsNewVariable() check - Use native union parameter type on resolveByRefParameterType Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 45ba2fd commit 0487f0a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Analyser/ExprHandler/FuncCallHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
222222
$innerParameters = $innerParametersAcceptor->getParameters();
223223
$innerArgs = $innerFuncCall->getArgs();
224224

225-
$innerCalleeReflection = $this->resolveCallUserFuncCalleeReflection($innerFuncCall, $scope);
225+
$innerCalleeReflection = null;
226226

227227
foreach ($innerArgs as $i => $innerArg) {
228228
$argValue = $innerArg->value;
@@ -241,6 +241,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
241241
continue;
242242
}
243243

244+
$innerCalleeReflection ??= $this->resolveCallUserFuncCalleeReflection($innerFuncCall, $scope);
244245
$byRefType = $nodeScopeResolver->resolveByRefParameterType($innerFuncCall, $innerCalleeReflection, $innerParameter, $scope);
245246
$scope = $nodeScopeResolver->processVirtualAssign(
246247
$scope,

0 commit comments

Comments
 (0)