protected function handleNotAllowed(array $allowed) { $exception = new HttpException\MethodNotAllowedException($allowed); if ($this->getStrategy() === RouteStrategyInterface::RESTFUL_STRATEGY) { return $exception->getJsonResponse(); } throw $exception; }