Completed
Pull Request — master (#12)
by Jeroen
12:10
created

EmptyResponseException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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