private function findParametersAcceptorInFunctionCall(Expr $functionCall, Scope $scope)
{
if ($functionCall instanceof FuncCall && $functionCall->name instanceof Name) {
if ($this->broker->hasFunction($functionCall->name, $scope)) {
return $this->broker->getFunction($functionCall->name, $scope);
}
} elseif ($functionCall instanceof MethodCall && is_string($functionCall->name)) {
$type = $scope->getType($functionCall->var);
if ($type->getClass() !== null && $this->broker->hasClass($type->getClass())) {
$classReflection = $this->broker->getClass($type->getClass());
$methodName = $functionCall->name;
if ($classReflection->hasMethod((string) $methodName)) {
return $classReflection->getMethod((string) $methodName);
}
}
} elseif ($functionCall instanceof Expr\StaticCall && $functionCall->class instanceof Name && is_string($functionCall->name)) {
$className = (string) $functionCall->class;
if ($this->broker->hasClass($className)) {
$classReflection = $this->broker->getClass($className);
if ($classReflection->hasMethod($functionCall->name)) {
return $classReflection->getMethod($functionCall->name);
}
}
}
return null;
}