RequestException::__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 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Thruster\Component\Http\Exception;
4
5
/**
6
 * Class RequestException
7
 *
8
 * @package Thruster\Component\Http\Exception
9
 * @author  Aurimas Niekis <[email protected]>
10
 */
11
class RequestException extends \Exception
12
{
13
    /**
14
     * @var int
15
     */
16
    protected $responseCode;
17
18
    /**
19
     * @param int    $code
20
     * @param string $message
21
     */
22 5
    public function __construct(int $code, string $message)
23
    {
24 5
        $this->responseCode = $code;
25
26 5
        parent::__construct($message, $code);
27 5
    }
28
29
    /**
30
     * @return int
31
     */
32
    public function getResponseCode()
33
    {
34
        return $this->responseCode;
35
    }
36
}
37