Passed
Push — 8.0 ( 495b3f...e5cbfb )
by liu
02:07
created

HttpException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getStatusCode() 0 3 1
A getHeaders() 0 3 1
A __construct() 0 3 1
1
<?php
2
// +----------------------------------------------------------------------
3
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006-2021 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
use Exception;
16
17
/**
18
 * HTTP异常
19
 */
20
class HttpException extends \RuntimeException
21
{
22
    public function __construct(private int $statusCode, string $message = '', Exception $previous = null, private array $headers = [], $code = 0)
23
    {
24
        parent::__construct($message, $code, $previous);
25
    }
26
27
    public function getStatusCode()
28
    {
29
        return $this->statusCode;
30
    }
31
32
    public function getHeaders()
33
    {
34
        return $this->headers;
35
    }
36
}
37