| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class MethodNotAllowedException extends RoutingException |
||
| 12 | { |
||
| 13 | /** @var string[] List of HTTP request methods that would be allowed */ |
||
| 14 | private $allowedMethods; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * MethodNotAllowedException constructor. |
||
| 18 | * @param string $message The exception message |
||
| 19 | * @param string[] $allowedMethods List of HTTP request methods that are allowed |
||
| 20 | */ |
||
| 21 | 2 | public function __construct(string $message, array $allowedMethods) |
|
| 22 | { |
||
| 23 | 2 | $this->allowedMethods = $allowedMethods; |
|
| 24 | |||
| 25 | 2 | parent::__construct($message); |
|
| 26 | 2 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Returns a list of allowed HTTP request methods. |
||
| 30 | * @return string[] List of allowed HTTP request methods |
||
| 31 | */ |
||
| 32 | 2 | public function getAllowedMethods(): array |
|
| 35 | } |
||
| 36 | } |
||
| 37 |