Completed
Push — 6.0 ( e89165...09da7f )
by liu
06:38 queued 15s
created

HttpException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 5
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
// +----------------------------------------------------------------------
3
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
6
// +----------------------------------------------------------------------
7
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
// +----------------------------------------------------------------------
9
// | Author: yunwuxin <[email protected]>
10
// +----------------------------------------------------------------------
11
declare (strict_types = 1);
12
13
namespace think\exception;
14
15
/**
16
 * HTTP异常
17
 */
18
class HttpException extends \RuntimeException
19
{
20
    private $statusCode;
0 ignored issues
show
Coding Style introduced by
Private member variable "statusCode" must be prefixed with an underscore
Loading history...
21
    private $headers;
0 ignored issues
show
Coding Style introduced by
Private member variable "headers" must be prefixed with an underscore
Loading history...
22
23
    public function __construct(int $statusCode, string $message = null, \Exception $previous = null, array $headers = [], $code = 0)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
24
    {
25
        $this->statusCode = $statusCode;
26
        $this->headers    = $headers;
27
28
        parent::__construct($message, $code, $previous);
29
    }
30
31
    public function getStatusCode()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getStatusCode()
Loading history...
32
    {
33
        return $this->statusCode;
34
    }
35
36
    public function getHeaders()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getHeaders()
Loading history...
37
    {
38
        return $this->headers;
39
    }
40
}
41