public function render(?Request $request = null): Response {
        $request = self::validateRequest($request);

        $translator = $this->translatorProvider->getPreferredTranslator(
            $request->getLanguages(),
            $this->config['default_language']
        );

        $response = new Response();

        $response->setContent($this->templateRenderer->render(
            $this->config['template_name'],
            array_merge($translator->getTranslations(), [
                'lang' => $translator->getLanguage(),
                'charset' => $this->config['charset']
            ])
        )."\n<!-- Powered by progminer/maintenance-screen (https://packagist.org/packages/progminer/maintenance-screen) -->\n");
        $response->headers->set('Content-Language', $translator->translate('lang'));

        return $response;
    }
public function render(?Request $request = null): Response {
        $request = self::validateRequest($request);

        $translator = $this->translatorProvider->getPreferredTranslator(
            $request->getLanguages(),
            $this->config['default_language']
        );

        $response = new Response();

        $response->setContent($this->templateRenderer->render(
            $this->config['template_name'],
            array_merge($translator->getTranslations(), [
                'lang' => $translator->getLanguage(),
                'charset' => $this->config['charset']
            ])
        )."\n<!-- Powered by progminer/maintenance-screen (https://packagist.org/packages/progminer/maintenance-screen) -->\n");
        $response->headers->set('Content-Language', $translator->translate('lang'));

        return $response;
    }
public function render ( ? Request $ request = null ) : Response { $ request = self :: validateRequest ( $ request ) ; $ translator = $ this -> translatorProvider -> getPreferredTranslator ( $ request -> getLanguages ( ) , $ this -> config [ 'default_language' ] ) ; $ response = new Response ( ) ; $ response -> setContent ( $ this -> templateRenderer -> render ( $ this -> config [ 'template_name' ] , array_merge ( $ translator -> getTranslations ( ) , [ 'lang' => $ translator -> getLanguage ( ) , 'charset' => $ this -> config [ 'charset' ] ] ) ) . "\n<!-- Powered by progminer/maintenance-screen (https://packagist.org/packages/progminer/maintenance-screen) -->\n" ) ; $ response -> headers -> set ( 'Content-Language' , $ translator -> translate ( 'lang' ) ) ; return $ response ; }
Renders maintenance screen for Request to Response

If Request is not provided uses
created from globals instance

@param Request|null $request Request for rendering

@return Response Rendered maintenance screen
Renders maintenance screen for Request to Response