Failed Conditions
Push — 0.2 ( 9080b3...48d4dc )
by Maximo
10:15 queued 04:56
created

HttpException::getHttpMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Exception;
6
7
use Canvas\Http\Response;
8
9
class HttpException extends Exception
10
{
11
    protected $httpCode = Response::BAD_REQUEST;
12
    protected $httpMessage = 'Bad Request';
13
    protected $data;
14
15
    /**
16
     * Get the http status code of the exception.
17
     *
18
     * @return string
19
     */
20
    public function getHttpCode(): int
21
    {
22
        return $this->httpCode;
23
    }
24
25
    /**
26
     * Get the message string from the exception.
27
     *
28
     * @return string
29
     */
30
    public function getHttpMessage(): string
31
    {
32
        return $this->httpMessage;
33
    }
34
35
    /**
36
     * Get the message DATA from the exception.
37
     *
38
     * @return string|null
39
     */
40
    public function getData(): ?string
41
    {
42
        return $this->data;
43
    }
44
}
45