1: <?php
2: namespace Izberg\Exception;
3: use Exception;
4: use RuntimeException;
5:
6: /**
7: * Represents an HTTP 405 error.
8: */
9: class MethodNotAllowedException extends HttpException {
10: /**
11: * Constructor
12: *
13: * @param string $message If no message is given 'Method Not Allowed' will be the message
14: * @param string $code Status code, defaults to 405
15: */
16: public function __construct($message = null, $code = 405) {
17: if (empty($message)) {
18: $message = 'Method Not Allowed';
19: }
20: parent::__construct($message, $code);
21: }
22: }
23: