Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Routing\Exception; Chris@0: Chris@0: /** Chris@0: * The resource was found but the request method is not allowed. Chris@0: * Chris@0: * This exception should trigger an HTTP 405 response in your application code. Chris@0: * Chris@0: * @author Kris Wallsmith Chris@0: */ Chris@0: class MethodNotAllowedException extends \RuntimeException implements ExceptionInterface Chris@0: { Chris@17: protected $allowedMethods = []; Chris@0: Chris@0: public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) Chris@0: { Chris@0: $this->allowedMethods = array_map('strtoupper', $allowedMethods); Chris@0: Chris@0: parent::__construct($message, $code, $previous); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets the allowed HTTP methods. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getAllowedMethods() Chris@0: { Chris@0: return $this->allowedMethods; Chris@0: } Chris@0: }