You are here

public function CallbackToken::__construct in Zircon Profile 8

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

Initializes token.

Parameters

callable $callback:

Throws

\Prophecy\Exception\InvalidArgumentException

File

vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php, line 32

Class

CallbackToken
Callback-verified token.

Namespace

Prophecy\Argument\Token

Code

public function __construct($callback) {
  if (!is_callable($callback)) {
    throw new InvalidArgumentException(sprintf('Callable expected as an argument to CallbackToken, but got %s.', gettype($callback)));
  }
  $this->callback = $callback;
}