~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.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\Message\ResponseInterface;
 
6
 
 
7
/**
 
8
 * Event object emitted after a request has been completed.
 
9
 *
 
10
 * You may change the Response associated with the request using the
 
11
 * intercept() method of the event.
 
12
 */
 
13
class CompleteEvent extends AbstractTransferEvent
 
14
{
 
15
    /**
 
16
     * Intercept the request and associate a response
 
17
     *
 
18
     * @param ResponseInterface $response Response to set
 
19
     */
 
20
    public function intercept(ResponseInterface $response)
 
21
    {
 
22
        $this->stopPropagation();
 
23
        $this->getTransaction()->setResponse($response);
 
24
    }
 
25
 
 
26
    /**
 
27
     * Get the response of the request
 
28
     *
 
29
     * @return ResponseInterface
 
30
     */
 
31
    public function getResponse()
 
32
    {
 
33
        return $this->getTransaction()->getResponse();
 
34
    }
 
35
}