src/Generator.php
public function generate(string $template, array $params = []): File {
    $template = $this->templates->child["$template.php"];

    if(!($template instanceof File)) {
      throw new NotAFileException($template->path);
    }

    $hash = $this->makeTemplateHash($template, $params);

    $compiled_file = $this->cache->child["$hash.php"];

    if(!$compiled_file->exists) {
      $compiled_code = $this->pipeline->compile($template, $params);
      $compiled_file = $this->cache->child["$hash.php"];
      $compiled_file->writeAll($compiled_code);
    }

    return $compiled_file;
  }
public function generate(string $template, array $params = []): File {
    $template = $this->templates->child["$template.php"];

    if(!($template instanceof File)) {
      throw new NotAFileException($template->path);
    }

    $hash = $this->makeTemplateHash($template, $params);

    $compiled_file = $this->cache->child["$hash.php"];

    if(!$compiled_file->exists) {
      $compiled_code = $this->pipeline->compile($template, $params);
      $compiled_file = $this->cache->child["$hash.php"];
      $compiled_file->writeAll($compiled_code);
    }

    return $compiled_file;
  }
@param  string   $template
@param  mixed[]  $params

@return  File  The cached compiled template

@throws  TemplateNotFoundException
@throws  NotAFileException