You are here

public function CallbackPrediction::__construct in Zircon Profile 8

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

Initializes callback prediction.

Parameters

callable $callback Custom callback:

Throws

\Prophecy\Exception\InvalidArgumentException

File

vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php, line 36

Class

CallbackPrediction
Callback prediction.

Namespace

Prophecy\Prediction

Code

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