class MethodNotAllowedException

The resource was found but the request method is not allowed.

This exception should trigger an HTTP 405 response in your application code.

@author Kris Wallsmith <kris@symfony.com>

@api

Hierarchy

Expanded class hierarchy of MethodNotAllowedException

11 files declare their use of MethodNotAllowedException
ApacheUrlMatcher.php in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php
ChainRouter.php in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ChainRouter.php
DynamicRouter.php in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/DynamicRouter.php
RequestMatcherInterface.php in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RequestMatcherInterface.php
RouterListener.php in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php

... See full list

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php, line 23

Namespace

Symfony\Component\Routing\Exception
View source
class MethodNotAllowedException extends \RuntimeException implements ExceptionInterface {

  /**
   * @var array
   */
  protected $allowedMethods = array();
  public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) {
    $this->allowedMethods = array_map('strtoupper', $allowedMethods);
    parent::__construct($message, $code, $previous);
  }

  /**
   * Gets the allowed HTTP methods.
   *
   * @return array
   */
  public function getAllowedMethods() {
    return $this->allowedMethods;
  }

}

Members