Completed
Push — master ( 0f4fe2...64d1c4 )
by Tobias
05:46 queued 03:44
created

History::addFailure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 2
1
<?php
2
3
/*
4
 * Copyright (C) 2013-2016 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\HttpClient\Plugin;
11
12
use Http\Client\Common\Plugin\Journal;
13
use Http\Client\Exception;
14
use Psr\Http\Message\RequestInterface;
15
use Psr\Http\Message\ResponseInterface;
16
17
/**
18
 * A plugin to remember the last response.
19
 *
20
 * @author Tobias Nyholm <[email protected]>
21
 */
22
class History implements Journal
23
{
24
    /**
25
     * @var ResponseInterface
26
     */
27
    private $lastResponse;
28
29
    /**
30
     * @return ResponseInterface|null
31
     */
32
    public function getLastResponse()
33
    {
34
        return $this->lastResponse;
35
    }
36
37
    public function addSuccess(RequestInterface $request, ResponseInterface $response)
38
    {
39
        $this->lastResponse = $response;
40
    }
41
42
    public function addFailure(RequestInterface $request, Exception $exception)
43
    {
44
    }
45
}
46