public function handleMethodNotAllowed() { $exception = new MethodNotAllowedException(); if ($this->getStrategy() instanceof RestfulStrategy) { return $exception->getJsonResponse(); } throw $exception; }
/** * Handles a not allowed route * * @param array $allowed * @return \Symfony\Component\HttpFoundation\Response */ protected function handleNotAllowed(array $allowed) { $exception = new MethodNotAllowedException($allowed); if ($this->getStrategy() instanceof RestfulStrategy) { return $exception->getJsonResponse(); } throw $exception; }