Skip to content

Commit

Permalink
revert pr
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jan 31, 2025
1 parent c86a336 commit 3268028
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public static function fromArray(array $data): self
$source = require dirname(__DIR__, 2).'/config/backup.php';

return new self(
backup: BackupConfig::fromArray(array_replace_recursive($source['backup'], $data['backup'] ?? [])),
notifications: NotificationsConfig::fromArray(array_replace_recursive($source['notifications'], $data['notifications'] ?? [])),
backup: BackupConfig::fromArray(array_merge($source['backup'], $data['backup'] ?? [])),
notifications: NotificationsConfig::fromArray(array_merge($source['notifications'], $data['notifications'] ?? [])),
monitoredBackups: MonitoredBackupsConfig::fromArray($data['monitor_backups'] ?? $source['monitor_backups']),
cleanup: CleanupConfig::fromArray(array_replace_recursive($source['cleanup'], $data['cleanup'] ?? []))
cleanup: CleanupConfig::fromArray(array_merge($source['cleanup'], $data['cleanup'] ?? []))
);
}
}
9 changes: 0 additions & 9 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@
expect($tempDirectory->path())->toBe('/foo');
});

it('merges the published config file with package config file', function () {
config()->set('backup.backup.destination', []);

$config = Config::fromArray(config('backup'));

expect($config->backup->destination)->toBeInstanceOf(DestinationConfig::class);
expect($config->backup->destination->compressionMethod)->toBe(ZipArchive::CM_DEFAULT);
});

it('merges the published config file with package config file and preserve published config values', function () {
config()->set('backup.backup.destination', ['compression_method' => ZipArchive::CM_DEFLATE]);

Expand Down

0 comments on commit 3268028

Please sign in to comment.