private function findParametersInFunctionCall(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)->getParameters();
}
} 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)->getParameters();
}
}
}
return null;
}