public function moveTo($path)
{
if (!$this->exists()) {
throw new \LogicException(sprintf('Cannot move output file to %s, file does not exist (path: %s).', $path, $this->path ?: '*none*'));
}
$before = $this->path;
$this->path = $path;
rename($before, $this->getOrCreatePath());
return $this;
}