Total Complexity | 2 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
23 | class MethodNotAllowedException extends RuntimeException implements ExceptionInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Allowed HTTP methods |
||
28 | * |
||
29 | * @var string[] |
||
30 | */ |
||
31 | private $allowedMethods; |
||
32 | |||
33 | /** |
||
34 | * Constructor of the class |
||
35 | * |
||
36 | * @param string[] $allowedMethods |
||
37 | * @param string $message |
||
38 | * @param int $code |
||
39 | * @param Throwable $previous |
||
40 | */ |
||
41 | 5 | public function __construct(array $allowedMethods, string $message = '', int $code = 0, Throwable $previous = null) |
|
42 | { |
||
43 | 5 | $this->allowedMethods = $allowedMethods; |
|
44 | |||
45 | 5 | parent::__construct($message, $code, $previous); |
|
46 | 5 | } |
|
47 | |||
48 | /** |
||
49 | * Gets allowed HTTP methods |
||
50 | * |
||
51 | * @return string[] |
||
52 | */ |
||
53 | 3 | public function getAllowedMethods() : array |
|
56 | } |
||
57 | } |
||
58 |