protected callClientMethods ( methodInfo[] $methods, Closure $stopWhen = null ) : PAGI\Client\Result\IResult | ||
$methods | methodInfo[] | Methods to call, an array of arrays. The second array has the method name as key and an array of arguments as value. |
$stopWhen | Closure | If any, this callback is evaluated before returning. Will return when false. |
Résultat | PAGI\Client\Result\IResult |
protected function callClientMethods($methods, $stopWhen = null)
{
$result = null;
foreach ($methods as $callInfo) {
foreach ($callInfo as $name => $arguments) {
$result = $this->callClientMethod($name, $arguments);
if ($stopWhen !== null) {
if ($stopWhen($result)) {
return $result;
}
}
}
}
return $result;
}