protected function templateExists($template)
    {
        $template = (string) $template;

        $loader = $this->twig->getLoader();
        if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) {
            return $loader->exists($template);
        }

        try {
            $loader->getSourceContext($template)->getCode();

            return true;
        } catch (LoaderError $e) {
        }

        return false;
    }
protected function templateExists($template)
    {
        $template = (string) $template;

        $loader = $this->twig->getLoader();
        if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) {
            return $loader->exists($template);
        }

        try {
            $loader->getSourceContext($template)->getCode();

            return true;
        } catch (LoaderError $e) {
        }

        return false;
    }
protected function templateExists ( $ template ) { $ template = ( string ) $ template ; $ loader = $ this -> twig -> getLoader ( ) ; if ( $ loader instanceof ExistsLoaderInterface || method_exists ( $ loader , 'exists' ) ) { return $ loader -> exists ( $ template ) ; } try { $ loader -> getSourceContext ( $ template ) -> getCode ( ) ; return true ; } catch ( LoaderError $ e ) { } return false ; }
to be removed when the minimum required version of Twig is >= 3.0
to be removed when the minimum required version of Twig is > = 3 . 0