You are here

public function ReturnArgumentPromise::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php \Prophecy\Promise\ReturnArgumentPromise::__construct()

Initializes callback promise.

Parameters

int $index The zero-indexed number of the argument to return:

Throws

\Prophecy\Exception\InvalidArgumentException

File

vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php, line 37

Class

ReturnArgumentPromise
Return argument promise.

Namespace

Prophecy\Promise

Code

public function __construct($index = 0) {
  if (!is_int($index) || $index < 0) {
    throw new InvalidArgumentException('Zero-based index expected as argument to ReturnArgumentPromise, but got %s.', $index);
  }
  $this->index = $index;
}