protected function getMethodNotAllowedResponse(MethodNotAllowed $exception): ResponseInterface
    {
        return (new Response())
            ->withStatusCode(405)
            ->withHeader('Allow', implode(', ', $exception->getAllowedMethods()))
            ->withBody([
                'type' => '',
                'title' => 'Method not allowed.',
                'method' => $exception->getMethod(),
                'allowed_methods' => $exception->getAllowedMethods(),
            ]);
    }