~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}