Completed
Push — master ( 467d47...6f2bb4 )
by Anton
14s
created

HttpException::getStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 4
ccs 0
cts 2
cp 0
c 0
b 0
f 0
cc 1
eloc 2
nop 0
crap 2
rs 10
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link      https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Http\Exception;
12
13
use Bluz\Common\Exception\CommonException;
14
use Bluz\Http\StatusCode;
15
16
/**
17
 * HttpException
18
 *
19
 * @package  Bluz\Http\Exception
20
 * @author   Anton Shevchuk
21
 */
22
class HttpException extends CommonException
23
{
24
    /**
25
     * @var integer Used as default HTTP code for exceptions
26
     */
27
    protected $code = StatusCode::INTERNAL_SERVER_ERROR;
28
29
    /**
30
     * Return HTTP Status Message
31
     *
32
     * @return string
33
     */
34
    public function getStatus() : string
35
    {
36
        return StatusCode::$statusTexts[$this->code];
37
    }
38
}
39