public function addOnFulfilled(callable $callback): void
    {
        if ($this->getState() === Promise::PENDING) {
            $this->onFulfilled[] = $callback;
        } elseif ($this->getState() === Promise::FULFILLED) {
            $response = call_user_func($callback, $this->responseBuilder->getResponse());
            if ($response instanceof ResponseInterface) {
                $this->responseBuilder->setResponse($response);
            }
        }
    }
public function addOnFulfilled(callable $callback): void
    {
        if ($this->getState() === Promise::PENDING) {
            $this->onFulfilled[] = $callback;
        } elseif ($this->getState() === Promise::FULFILLED) {
            $response = call_user_func($callback, $this->responseBuilder->getResponse());
            if ($response instanceof ResponseInterface) {
                $this->responseBuilder->setResponse($response);
            }
        }
    }
public function addOnFulfilled ( callable $ callback ) : void { if ( $ this -> getState ( ) === Promise :: PENDING ) { $ this -> onFulfilled [ ] = $ callback ; } elseif ( $ this -> getState ( ) === Promise :: FULFILLED ) { $ response = call_user_func ( $ callback , $ this -> responseBuilder -> getResponse ( ) ) ; if ( $ response instanceof ResponseInterface ) { $ this -> responseBuilder -> setResponse ( $ response ) ; } } }
Add on fulfilled callback.

@param callable $callback
Add on fulfilled callback .