function CallbackPromise::execute
Overrides PromiseInterface::execute
File
-
vendor/
phpspec/ prophecy/ src/ Prophecy/ Promise/ CallbackPromise.php, line 48
Class
- CallbackPromise
- Evaluates promise callback.
Namespace
Prophecy\PromiseCode
public function execute(array $args, 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;
}
return call_user_func($callback, $args, $object, $method);
}