protected function addLoaderPaths(\Twig_Loader_Filesystem $loader, $paths)
    {
        foreach ((array)$paths as $namespace => $path) {
            if (is_int($namespace)) {
                $namespace = \Twig_Loader_Filesystem::MAIN_NAMESPACE;
            }

            $loader->addPath($path, $namespace);
        }
    }