resolve($value); }; /** * Fails the promise with the given exception. * * @param \Throwable $reason */ $fail = function (\Throwable $reason) { $this->fail($reason); }; $resolver($resolve, $fail); } }