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

EmptyResponseException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getResponse() 0 4 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