private function addResolvedPath(SplFileInfo $file, array & $map, $basePath, TemplatePathStack $resolver)
    {
        $filePath      = $file->getRealPath();
        $fileName      = pathinfo($filePath, PATHINFO_FILENAME);
        $relativePath  = trim(str_replace($basePath, '', $file->getPath()), '/\\');
        $templateName  = str_replace('\\', '/', trim($relativePath . '/' . $fileName, '/'));

        if ($fileName && ($resolvedPath = $resolver->resolve($templateName))) {
            $map[$templateName] = realpath($resolvedPath);
        }
    }