function CallbackToken::__construct
Initializes token.
Parameters
callable $callback:
string|null $customStringRepresentation Customize the __toString() representation of this token:
Throws
\Prophecy\Exception\InvalidArgumentException
File
-
vendor/
phpspec/ prophecy/ src/ Prophecy/ Argument/ Token/ CallbackToken.php, line 38
Class
- CallbackToken
- Callback-verified token.
Namespace
Prophecy\Argument\TokenCode
public function __construct($callback, ?string $customStringRepresentation = null) {
if (!is_callable($callback)) {
throw new InvalidArgumentException(sprintf('Callable expected as an argument to CallbackToken, but got %s.', gettype($callback)));
}
$this->callback = $callback;
$this->customStringRepresentation = $customStringRepresentation;
}