public function update($force = false)
{
if ($this->files !== null || $force) {
$this->update();
}
$this->files = array();
foreach ($this->directories as $directory) {
$finder = Finder::create()->sortByName()->in($directory)->name('*.html');
foreach ($finder as $file) {
$current = (string) $file;
if (0 !== strpos($current, $directory)) {
throw new \LogicException(sprintf('File resolved out of directory: %s (out of %s).', $current, $directory));
}
$current = substr($current, strlen($directory) + 1);
$current = str_replace('\\', '/', $current);
$this->files[$current] = (string) $file;
}
}
return $this;
}