EmptyResponseException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace TreeHouse\Feeder\Exception;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
class EmptyResponseException extends TransportException
8
{
9
    /**
10
     * @var ResponseInterface
11
     */
12
    private $response;
13
14
    /**
15
     * @param ResponseInterface $response
16
     */
17 4
    public function __construct(ResponseInterface $response)
18
    {
19 4
        $this->response = $response;
20
21 4
        parent::__construct('Server did not return any content, status code was ' . $response->getStatusCode());
22 4
    }
23
24
    /**
25
     * @return ResponseInterface
26
     */
27
    public function getResponse()
28
    {
29
        return $this->response;
30
    }
31
}
32