/**
  * {@inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     $templates = [];
     $themes = $this->themeRepository->findAll();
     /** @var TemplateReferenceInterface $template */
     foreach ($this->finder->findAllTemplates() as $template) {
         $this->themeContext->clear();
         foreach ($themes as $theme) {
             $this->themeContext->setTheme($theme);
             $path = $this->locator->locate($template);
             $templates[$template->getLogicalName() . "|" . $theme->getLogicalName()] = $path;
         }
         $templates[$template->getLogicalName()] = $this->locator->locate($template);
     }
     $this->writeCacheFile($cacheDir . '/templates.php', sprintf('<?php return %s;', var_export($templates, true)));
 }