protected function replaceFile(string $filename)
{
$supplier = $this->supplier->getName();
$pieces = [ROOT, 'Cabin', $supplier, $this->name];
$cabinRoot = \implode(DIRECTORY_SEPARATOR, $pieces);
if (\file_exists($cabinRoot . DIRECTORY_SEPARATOR . $filename . '.backup')) {
\unlink($cabinRoot . DIRECTORY_SEPARATOR . $filename . '.backup');
}
\rename($cabinRoot . DIRECTORY_SEPARATOR . $filename, $cabinRoot . DIRECTORY_SEPARATOR . $filename . '.backup');
return \file_put_contents($cabinRoot . DIRECTORY_SEPARATOR . $filename, \file_get_contents('phar://' . $this->pharAlias . '/' . $filename));
}