Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConsecutiveCalls.php

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\Stub

Code

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;
}
RSS feed
Powered by Drupal