protected function templateExists($template)
    {
        $loader = $this->twig->getLoader();
        if ($loader instanceof ExistsLoaderInterface) {
            return $loader->exists($template);
        }

        try {
            if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
                $loader->getSourceContext($template);
            } else {
                $loader->getSource($template);
            }

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

        return false;
    }
protected function templateExists($template)
    {
        $loader = $this->twig->getLoader();
        if ($loader instanceof ExistsLoaderInterface) {
            return $loader->exists($template);
        }

        try {
            if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
                $loader->getSourceContext($template);
            } else {
                $loader->getSource($template);
            }

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

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