Total Complexity | 3 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
23 | class UnauthorizedException extends RuntimeException implements AuthenticationExceptionInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $headers = []; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $body = ''; |
||
34 | |||
35 | /** |
||
36 | * Constructor |
||
37 | * |
||
38 | * @param array $headers The headers that should be sent in the unauthorized challenge response. |
||
39 | * @param string $body The response body that should be sent in the challenge response. |
||
40 | * @param int $code The exception code that will be used as a HTTP status code |
||
41 | */ |
||
42 | 18 | public function __construct(array $headers, string $body = '', $code = 401) |
|
47 | 18 | } |
|
48 | |||
49 | /** |
||
50 | * Get the headers. |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | 15 | public function getHeaders(): array |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * Get the body. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | 3 | public function getBody(): string |
|
69 |