/**
  * @param string $file
  *
  * @return string
  * @throws FileNotFoundException
  */
 private function resolvePath($file)
 {
     $resetDir = getcwd();
     chdir($this->config->getDirectory());
     if (strpos($file, '@') === 0) {
         return $file;
     }
     $extension = pathinfo($file, PATHINFO_EXTENSION);
     if (!file_exists($file) && in_array($extension, $this->requiredExtensions)) {
         throw new FileNotFoundException(sprintf('The required file "%s" could not be found. Did you accidentally deleted the "components" directory?', $file));
     }
     $path = realpath($file) ?: "";
     chdir($resetDir);
     return $path;
 }