function ConsecutiveCalls::invoke
Throws
NoMoreReturnValuesConfiguredException
Overrides Stub::invoke
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ MockObject/ Runtime/ Stub/ ConsecutiveCalls.php, line 36
Class
- ConsecutiveCalls
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\Framework\MockObject\StubCode
public function invoke(Invocation $invocation) : mixed {
if (empty($this->stack)) {
throw new NoMoreReturnValuesConfiguredException($invocation, $this->numberOfConfiguredReturnValues);
}
$value = array_shift($this->stack);
if ($value instanceof Stub) {
$value = $value->invoke($invocation);
}
return $value;
}