Open Journal Systems  3.3.0
TransferStats.php
1 <?php
2 namespace GuzzleHttp;
3 
7 
12 final class TransferStats
13 {
14  private $request;
15  private $response;
16  private $transferTime;
17  private $handlerStats;
18  private $handlerErrorData;
19 
27  public function __construct(
28  RequestInterface $request,
29  ResponseInterface $response = null,
30  $transferTime = null,
31  $handlerErrorData = null,
32  $handlerStats = []
33  ) {
34  $this->request = $request;
35  $this->response = $response;
36  $this->transferTime = $transferTime;
37  $this->handlerErrorData = $handlerErrorData;
38  $this->handlerStats = $handlerStats;
39  }
40 
44  public function getRequest()
45  {
46  return $this->request;
47  }
48 
54  public function getResponse()
55  {
56  return $this->response;
57  }
58 
64  public function hasResponse()
65  {
66  return $this->response !== null;
67  }
68 
78  public function getHandlerErrorData()
79  {
80  return $this->handlerErrorData;
81  }
82 
88  public function getEffectiveUri()
89  {
90  return $this->request->getUri();
91  }
92 
98  public function getTransferTime()
99  {
100  return $this->transferTime;
101  }
102 
108  public function getHandlerStats()
109  {
110  return $this->handlerStats;
111  }
112 
120  public function getHandlerStat($stat)
121  {
122  return isset($this->handlerStats[$stat])
123  ? $this->handlerStats[$stat]
124  : null;
125  }
126 }
GuzzleHttp
Definition: vendor/guzzlehttp/guzzle/src/Client.php:2
GuzzleHttp\TransferStats\getRequest
getRequest()
Definition: TransferStats.php:44
Psr\Http\Message\RequestInterface
Definition: vendor/psr/http-message/src/RequestInterface.php:24
GuzzleHttp\TransferStats\getHandlerErrorData
getHandlerErrorData()
Definition: TransferStats.php:78
GuzzleHttp\TransferStats\__construct
__construct(RequestInterface $request, ResponseInterface $response=null, $transferTime=null, $handlerErrorData=null, $handlerStats=[])
Definition: TransferStats.php:27
GuzzleHttp\TransferStats\getHandlerStats
getHandlerStats()
Definition: TransferStats.php:108
Psr\Http\Message\UriInterface
Definition: UriInterface.php:24
GuzzleHttp\TransferStats
Definition: TransferStats.php:12
Psr\Http\Message\ResponseInterface
Definition: vendor/psr/http-message/src/ResponseInterface.php:20
GuzzleHttp\TransferStats\hasResponse
hasResponse()
Definition: TransferStats.php:64
GuzzleHttp\TransferStats\getEffectiveUri
getEffectiveUri()
Definition: TransferStats.php:88
GuzzleHttp\TransferStats\getTransferTime
getTransferTime()
Definition: TransferStats.php:98
GuzzleHttp\TransferStats\getHandlerStat
getHandlerStat($stat)
Definition: TransferStats.php:120
GuzzleHttp\TransferStats\getResponse
getResponse()
Definition: TransferStats.php:54