onFulfilled example

public function __invoke(RequestInterface $request, array $options): PromiseInterface
    {
        if (!isset($options['retries'])) {
            $options['retries'] = 0;
        }

        $fn = $this->nextHandler;

        return $fn($request$options)
            ->then(
                $this->onFulfilled($request$options),
                $this->onRejected($request$options)
            );
    }

    /** * Execute fulfilled closure */
    private function onFulfilled(RequestInterface $request, array $options): callable
    {
        return function D$value) use ($request$options) {
            if (!($this->decider)(
                
Home | Imprint | This part of the site doesn't use cookies.