src/Framework/Http/Middleware/Router/RouterMiddleware.php
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(),
            ]);
    }
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(),
            ]);
    }
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 ( ) , ] ) ; }
Get response for MethodNotAllowed exception.

@param MethodNotAllowed $exception
@return ResponseInterface
Get response for MethodNotAllowed exception .