. */ declare(strict_types=1); namespace SP\Domain\Export\Dtos; /** * Class BackupFiles */ final readonly class BackupFiles { private const BACKUP_PREFIX = 'sysPassBackup'; public function __construct(private BackupFile $appBackupFile, private BackupFile $dbBackupFile) { } public static function buildHash(): string { return sha1(uniqid(self::BACKUP_PREFIX, true)); } public function getAppBackupFile(): BackupFile { return $this->appBackupFile; } public function getDbBackupFile(): BackupFile { return $this->dbBackupFile; } public function withPath(string $path): BackupFiles { return new self($this->appBackupFile->withPath($path), $this->dbBackupFile->withPath($path)); } public function withHash(string $hash): BackupFiles { return new self($this->appBackupFile->withHash($hash), $this->dbBackupFile->withHash($hash)); } }