emit($value); }; /** * Completes the observable with the given value. * * @param mixed $value */ $resolve = function ($value = null) { $this->resolve($value); }; /** * Fails the observable with the given exception. * * @param \Throwable $reason */ $fail = function (\Throwable $reason) { $this->fail($reason); }; try { $emitter($emit, $resolve, $fail); } catch (\Throwable $exception) { $this->fail($exception); } } }