src/Routing/src/Exception/MethodNotAllowedException.php
protected function buildMessage(array $allowedMethods): string
    {
        $ending = 'Allowed method is: %s';

        if (count($allowedMethods) > 1) {
            $ending = 'Allowed methods are: %s';
        }

        return sprintf('Method is not allowed. ' . $ending, implode(', ', $allowedMethods));
    }
protected function buildMessage(array $allowedMethods): string
    {
        $ending = 'Allowed method is: %s';

        if (count($allowedMethods) > 1) {
            $ending = 'Allowed methods are: %s';
        }

        return sprintf('Method is not allowed. ' . $ending, implode(', ', $allowedMethods));
    }
protected function buildMessage ( array $ allowedMethods ) : string { $ ending = 'Allowed method is: %s' ; if ( count ( $ allowedMethods ) > 1 ) { $ ending = 'Allowed methods are: %s' ; } return sprintf ( 'Method is not allowed. ' . $ ending , implode ( ', ' , $ allowedMethods ) ) ; }
Builds error message

@param  array $allowedMethods
@return string
Builds error message