Completed
Push — master ( 5d2770...16a580 )
by Enrico
02:38
created

HttpException::getStatusCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace uSILEX\Exception;
4
5
/**
6
 * HttpException.
7
 *
8
 * @author Kris Wallsmith <[email protected]>
9
 */
10
class HttpException extends \RuntimeException implements HttpExceptionInterface
11
{
12
    private $statusCode;
13
    private $headers;
14
15 3
    public function __construct(int $statusCode, string $message = null, \Exception $previous = null, array $headers = array(), ?int $code = 0)
16
    {
17 3
        $this->statusCode = $statusCode;
18 3
        $this->headers = $headers;
19
20 3
        parent::__construct($message, $code, $previous);
21 3
    }
22
23 1
    public function getStatusCode()
24
    {
25 1
        return $this->statusCode;
26
    }
27
28
    public function getHeaders()
29
    {
30
        return $this->headers;
31
    }
32
33
    /**
34
     * Set response headers.
35
     *
36
     * @param array $headers Response headers
37
     */
38
    public function setHeaders(array $headers)
39
    {
40
        $this->headers = $headers;
41
    }
42
}
43