You are here

public function CallbackPrediction::check 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::check()

Executes preset callback.

Parameters

Call[] $calls:

ObjectProphecy $object:

MethodProphecy $method:

Overrides PredictionInterface::check

File

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

Class

CallbackPrediction
Callback prediction.

Namespace

Prophecy\Prediction

Code

public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) {
  $callback = $this->callback;
  if ($callback instanceof Closure && method_exists('Closure', 'bind')) {
    $callback = Closure::bind($callback, $object);
  }
  call_user_func($callback, $calls, $object, $method);
}