scratch – Blame information for rev 87
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
87 | office | 1 | <?php |
2 | |||
3 | namespace GuzzleHttp\Event; |
||
4 | |||
5 | use GuzzleHttp\Adapter\TransactionInterface; |
||
6 | use GuzzleHttp\ClientInterface; |
||
7 | use GuzzleHttp\Message\RequestInterface; |
||
8 | |||
9 | abstract class AbstractRequestEvent extends AbstractEvent |
||
10 | { |
||
11 | /** @var TransactionInterface */ |
||
12 | private $transaction; |
||
13 | |||
14 | /** |
||
15 | * @param TransactionInterface $transaction |
||
16 | */ |
||
17 | public function __construct(TransactionInterface $transaction) |
||
18 | { |
||
19 | $this->transaction = $transaction; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Get the client associated with the event |
||
24 | * |
||
25 | * @return ClientInterface |
||
26 | */ |
||
27 | public function getClient() |
||
28 | { |
||
29 | return $this->transaction->getClient(); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Get the request object |
||
34 | * |
||
35 | * @return RequestInterface |
||
36 | */ |
||
37 | public function getRequest() |
||
38 | { |
||
39 | return $this->transaction->getRequest(); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return TransactionInterface |
||
44 | */ |
||
45 | protected function getTransaction() |
||
46 | { |
||
47 | return $this->transaction; |
||
48 | } |
||
49 | } |