4
use GuzzleHttp\Message\RequestInterface;
5
use GuzzleHttp\Message\ResponseInterface;
8
* Represents the relationship between a client, request, and response.
10
* You can access the request, response, and client using their corresponding
16
* HTTP client used to transfer the request.
18
* @var ClientInterface
23
* The request that is being sent.
25
* @var RequestInterface
30
* The response associated with the transaction. A response will not be
31
* present when a networking error occurs or an error occurs before sending
34
* @var ResponseInterface|null
39
* Exception associated with the transaction. If this exception is present
40
* when processing synchronous or future commands, then it is thrown. When
41
* intercepting a failed transaction, you MUST set this value to null in
42
* order to prevent the exception from being thrown.
49
* Associative array of handler specific transfer statistics and custom
50
* key value pair information. When providing similar information, handlers
51
* should follow the same key value pair naming conventions as PHP's
52
* curl_getinfo() (http://php.net/manual/en/function.curl-getinfo.php).
56
public $transferInfo = [];
59
* The number of transaction retries.
66
* The transaction's current state.
73
* Whether or not this is a future transaction. This value should not be
74
* changed after the future is constructed.
81
* The number of state transitions that this transaction has been through.
84
* @internal This is for internal use only. If you modify this, then you
85
* are asking for trouble.
87
public $_transitionCount = 0;
90
* @param ClientInterface $client Client that is used to send the requests
91
* @param RequestInterface $request Request to send
92
* @param bool $future Whether or not this is a future request.
94
public function __construct(
95
ClientInterface $client,
96
RequestInterface $request,
99
$this->client = $client;
100
$this->request = $request;
101
$this->_future = $future;