Chris@0: request = $request; Chris@0: $this->response = $response; Chris@0: $this->transferTime = $transferTime; Chris@0: $this->handlerErrorData = $handlerErrorData; Chris@0: $this->handlerStats = $handlerStats; Chris@0: } Chris@0: Chris@0: /** Chris@0: * @return RequestInterface Chris@0: */ Chris@0: public function getRequest() Chris@0: { Chris@0: return $this->request; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the response that was received (if any). Chris@0: * Chris@0: * @return ResponseInterface|null Chris@0: */ Chris@0: public function getResponse() Chris@0: { Chris@0: return $this->response; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns true if a response was received. Chris@0: * Chris@0: * @return bool Chris@0: */ Chris@0: public function hasResponse() Chris@0: { Chris@0: return $this->response !== null; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets handler specific error data. Chris@0: * Chris@0: * This might be an exception, a integer representing an error code, or Chris@0: * anything else. Relying on this value assumes that you know what handler Chris@0: * you are using. Chris@0: * Chris@0: * @return mixed Chris@0: */ Chris@0: public function getHandlerErrorData() Chris@0: { Chris@0: return $this->handlerErrorData; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Get the effective URI the request was sent to. Chris@0: * Chris@0: * @return UriInterface Chris@0: */ Chris@0: public function getEffectiveUri() Chris@0: { Chris@0: return $this->request->getUri(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Get the estimated time the request was being transferred by the handler. Chris@0: * Chris@0: * @return float Time in seconds. Chris@0: */ Chris@0: public function getTransferTime() Chris@0: { Chris@0: return $this->transferTime; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets an array of all of the handler specific transfer data. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getHandlerStats() Chris@0: { Chris@0: return $this->handlerStats; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Get a specific handler statistic from the handler by name. Chris@0: * Chris@0: * @param string $stat Handler specific transfer stat to retrieve. Chris@0: * Chris@0: * @return mixed|null Chris@0: */ Chris@0: public function getHandlerStat($stat) Chris@0: { Chris@0: return isset($this->handlerStats[$stat]) Chris@0: ? $this->handlerStats[$stat] Chris@0: : null; Chris@0: } Chris@0: }