public function resolve(ResponseInterface $response)
    {
        if (HttpPromise::PENDING !== $this->state) {
            throw new \RuntimeException('Promise is already resolved');
        }

        $this->state = HttpPromise::FULFILLED;
        $this->response = $response;
        $this->doResolve($response);
    }
public function resolve(ResponseInterface $response)
    {
        if (HttpPromise::PENDING !== $this->state) {
            throw new \RuntimeException('Promise is already resolved');
        }

        $this->state = HttpPromise::FULFILLED;
        $this->response = $response;
        $this->doResolve($response);
    }
public function resolve ( ResponseInterface $ response ) { if ( HttpPromise :: PENDING !== $ this -> state ) { throw new \ RuntimeException ( 'Promise is already resolved' ) ; } $ this -> state = HttpPromise :: FULFILLED ; $ this -> response = $ response ; $ this -> doResolve ( $ response ) ; }
Resolve this promise.

@param ResponseInterface $response

@internal
Resolve this promise .