HttpException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 5
dl 0
loc 11
ccs 0
cts 4
cp 0
crap 2
rs 10
c 3
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Suricate\Exception;
6
7
class HttpException extends \RuntimeException
8
{
9
    private $statusCode;
10
    private $headers;
11
12
    public function __construct(
13
        $statusCode,
14
        $message = null,
15
        \Exception $previous = null,
16
        array $headers = [],
17
        $code = 0
18
    ) {
19
        $this->statusCode = $statusCode;
20
        $this->headers = $headers;
21
22
        parent::__construct($message, $code, $previous);
23
    }
24
25
    public function getStatusCode()
26
    {
27
        return $this->statusCode;
28
    }
29
30
    public function getHeaders()
31
    {
32
        return $this->headers;
33
    }
34
}
35