Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CallbackPrediction.php

function CallbackPrediction::check

Overrides PredictionInterface::check

File

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

Class

CallbackPrediction
Executes preset callback.

Namespace

Prophecy\Prediction

Code

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);
}
RSS feed
Powered by Drupal