function CallbackPrediction::check
Overrides PredictionInterface::check
File
-
vendor/
phpspec/ prophecy/ src/ Prophecy/ Prediction/ CallbackPrediction.php, line 47
Class
- CallbackPrediction
- Executes preset callback.
Namespace
Prophecy\PredictionCode
public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) {
$callback = $this->callback;
if ($callback instanceof Closure && method_exists('Closure', 'bind') && (new ReflectionFunction($callback))->getClosureThis() !== null) {
$callback = Closure::bind($callback, $object) ?? $this->callback;
}
call_user_func($callback, $calls, $object, $method);
}