diff --git a/composer.json b/composer.json index 11d9c522..ba7e9803 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "test": "vendor/bin/pest --compact", "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", "analyse": "vendor/bin/phpstan analyse", - "rector": "./vendor/bin/rector --dry-run", + "rector": "vendor/bin/rector --dry-run", "baseline": "./vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G" }, "suggest": { diff --git a/src/BackupDestination/BackupDestination.php b/src/BackupDestination/BackupDestination.php index 3ef69882..ec047c98 100644 --- a/src/BackupDestination/BackupDestination.php +++ b/src/BackupDestination/BackupDestination.php @@ -14,9 +14,7 @@ class BackupDestination protected ?BackupCollection $backupCollectionCache = null; - public function __construct(protected ?Filesystem $disk, protected string $backupName, protected string $diskName) - { - } + public function __construct(protected ?Filesystem $disk, protected string $backupName, protected string $diskName) {} public function disk(): Filesystem { diff --git a/src/BackupServiceProvider.php b/src/BackupServiceProvider.php index 92e10d75..037c5464 100644 --- a/src/BackupServiceProvider.php +++ b/src/BackupServiceProvider.php @@ -52,7 +52,7 @@ public function packageRegistered(): void $this->registerDiscordChannel(); - $this->app->scoped(Config::class, function (): \Spatie\Backup\Config\Config { + $this->app->scoped(Config::class, function (): Config { return Config::fromArray(config('backup')); }); } @@ -60,7 +60,7 @@ public function packageRegistered(): void protected function registerDiscordChannel(): void { Notification::resolved(function (ChannelManager $service) { - $service->extend('discord', function ($app): \Spatie\Backup\Notifications\Channels\Discord\DiscordChannel { + $service->extend('discord', function ($app): DiscordChannel { return new DiscordChannel(); }); }); diff --git a/src/Config/Config.php b/src/Config/Config.php index e99baa30..78f9787b 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -11,8 +11,7 @@ protected function __construct( public NotificationsConfig $notifications, public MonitoredBackupsConfig $monitoredBackups, public CleanupConfig $cleanup, - ) { - } + ) {} /** @internal used for testing */ public static function rebind(): void diff --git a/src/Config/MonitoredBackupConfig.php b/src/Config/MonitoredBackupConfig.php index c3668a74..e24d5c40 100644 --- a/src/Config/MonitoredBackupConfig.php +++ b/src/Config/MonitoredBackupConfig.php @@ -15,8 +15,7 @@ protected function __construct( public string $name, public array $disks, public array $healthChecks, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/MonitoredBackupsConfig.php b/src/Config/MonitoredBackupsConfig.php index 7d2ae1fd..7962247c 100644 --- a/src/Config/MonitoredBackupsConfig.php +++ b/src/Config/MonitoredBackupsConfig.php @@ -11,8 +11,7 @@ class MonitoredBackupsConfig extends Data */ protected function __construct( public array $monitorBackups, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/NotificationDiscordConfig.php b/src/Config/NotificationDiscordConfig.php index 46ce63f9..adbb3dc7 100644 --- a/src/Config/NotificationDiscordConfig.php +++ b/src/Config/NotificationDiscordConfig.php @@ -10,8 +10,7 @@ protected function __construct( public string $webhookUrl, public string $username, public string $avatar_url, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/NotificationMailConfig.php b/src/Config/NotificationMailConfig.php index 414c575a..65c04231 100644 --- a/src/Config/NotificationMailConfig.php +++ b/src/Config/NotificationMailConfig.php @@ -10,8 +10,7 @@ class NotificationMailConfig extends Data protected function __construct( public string $to, public NotificationMailSenderConfig $from, - ) { - } + ) {} /** * @param array $data diff --git a/src/Config/NotificationMailSenderConfig.php b/src/Config/NotificationMailSenderConfig.php index 3013d9b7..0e674551 100644 --- a/src/Config/NotificationMailSenderConfig.php +++ b/src/Config/NotificationMailSenderConfig.php @@ -10,8 +10,7 @@ class NotificationMailSenderConfig extends Data protected function __construct( public string $address, public ?string $name, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/NotificationSlackConfig.php b/src/Config/NotificationSlackConfig.php index ae02f391..407ce415 100644 --- a/src/Config/NotificationSlackConfig.php +++ b/src/Config/NotificationSlackConfig.php @@ -11,8 +11,7 @@ protected function __construct( public ?string $channel, public ?string $username, public ?string $icon, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/SourceConfig.php b/src/Config/SourceConfig.php index 2bc9ba6d..ce03aeaa 100644 --- a/src/Config/SourceConfig.php +++ b/src/Config/SourceConfig.php @@ -12,8 +12,7 @@ class SourceConfig extends Data protected function __construct( public SourceFilesConfig $files, public array $databases, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/SourceFilesConfig.php b/src/Config/SourceFilesConfig.php index 1fa2b5cc..3cef60d6 100644 --- a/src/Config/SourceFilesConfig.php +++ b/src/Config/SourceFilesConfig.php @@ -16,8 +16,7 @@ protected function __construct( public bool $followLinks, public bool $ignoreUnreadableDirectories, public ?string $relativePath, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Config/StrategyConfig.php b/src/Config/StrategyConfig.php index 2c25e6d0..cf7802b5 100644 --- a/src/Config/StrategyConfig.php +++ b/src/Config/StrategyConfig.php @@ -13,8 +13,7 @@ protected function __construct( public int $keepMonthlyBackupsForMonths, public int $keepYearlyBackupsForYears, public int $deleteOldestBackupsWhenUsingMoreMegabytesThan, - ) { - } + ) {} /** @param array $data */ public static function fromArray(array $data): self diff --git a/src/Events/BackupHasFailed.php b/src/Events/BackupHasFailed.php index 66454cf8..8bf68229 100644 --- a/src/Events/BackupHasFailed.php +++ b/src/Events/BackupHasFailed.php @@ -10,6 +10,5 @@ class BackupHasFailed public function __construct( public Exception $exception, public ?BackupDestination $backupDestination = null, - ) { - } + ) {} } diff --git a/src/Events/BackupManifestWasCreated.php b/src/Events/BackupManifestWasCreated.php index 5d45aa2f..3cb8aec0 100644 --- a/src/Events/BackupManifestWasCreated.php +++ b/src/Events/BackupManifestWasCreated.php @@ -8,6 +8,5 @@ class BackupManifestWasCreated { public function __construct( public Manifest $manifest, - ) { - } + ) {} } diff --git a/src/Events/BackupWasSuccessful.php b/src/Events/BackupWasSuccessful.php index de686fa6..8b562be2 100644 --- a/src/Events/BackupWasSuccessful.php +++ b/src/Events/BackupWasSuccessful.php @@ -8,6 +8,5 @@ class BackupWasSuccessful { public function __construct( public BackupDestination $backupDestination, - ) { - } + ) {} } diff --git a/src/Events/BackupZipWasCreated.php b/src/Events/BackupZipWasCreated.php index 211730d9..4106311f 100644 --- a/src/Events/BackupZipWasCreated.php +++ b/src/Events/BackupZipWasCreated.php @@ -6,6 +6,5 @@ class BackupZipWasCreated { public function __construct( public string $pathToZip, - ) { - } + ) {} } diff --git a/src/Events/CleanupHasFailed.php b/src/Events/CleanupHasFailed.php index 709cb299..6d97ecc5 100644 --- a/src/Events/CleanupHasFailed.php +++ b/src/Events/CleanupHasFailed.php @@ -10,6 +10,5 @@ class CleanupHasFailed public function __construct( public Exception $exception, public ?BackupDestination $backupDestination = null, - ) { - } + ) {} } diff --git a/src/Events/CleanupWasSuccessful.php b/src/Events/CleanupWasSuccessful.php index 4306284c..a9bd8ebe 100644 --- a/src/Events/CleanupWasSuccessful.php +++ b/src/Events/CleanupWasSuccessful.php @@ -8,6 +8,5 @@ class CleanupWasSuccessful { public function __construct( public BackupDestination $backupDestination, - ) { - } + ) {} } diff --git a/src/Events/DumpingDatabase.php b/src/Events/DumpingDatabase.php index a66afe89..98faf17f 100644 --- a/src/Events/DumpingDatabase.php +++ b/src/Events/DumpingDatabase.php @@ -8,6 +8,5 @@ class DumpingDatabase { public function __construct( public DbDumper $dbDumper - ) { - } + ) {} } diff --git a/src/Events/HealthyBackupWasFound.php b/src/Events/HealthyBackupWasFound.php index 75d89cfa..0d76759c 100644 --- a/src/Events/HealthyBackupWasFound.php +++ b/src/Events/HealthyBackupWasFound.php @@ -8,6 +8,5 @@ class HealthyBackupWasFound { public function __construct( public BackupDestinationStatus $backupDestinationStatus, - ) { - } + ) {} } diff --git a/src/Events/UnhealthyBackupWasFound.php b/src/Events/UnhealthyBackupWasFound.php index 77d698e7..503945b1 100644 --- a/src/Events/UnhealthyBackupWasFound.php +++ b/src/Events/UnhealthyBackupWasFound.php @@ -8,6 +8,5 @@ class UnhealthyBackupWasFound { public function __construct( public BackupDestinationStatus $backupDestinationStatus - ) { - } + ) {} } diff --git a/src/Notifications/EventHandler.php b/src/Notifications/EventHandler.php index 6f1fdeec..6289238a 100644 --- a/src/Notifications/EventHandler.php +++ b/src/Notifications/EventHandler.php @@ -17,8 +17,7 @@ class EventHandler { public function __construct( protected Repository $config - ) { - } + ) {} public function subscribe(Dispatcher $events): void { diff --git a/src/Notifications/Notifications/BackupHasFailedNotification.php b/src/Notifications/Notifications/BackupHasFailedNotification.php index 5e59c50d..ba768d3f 100644 --- a/src/Notifications/Notifications/BackupHasFailedNotification.php +++ b/src/Notifications/Notifications/BackupHasFailedNotification.php @@ -13,8 +13,7 @@ class BackupHasFailedNotification extends BaseNotification { public function __construct( public BackupHasFailed $event, - ) { - } + ) {} public function toMail(): MailMessage { diff --git a/src/Notifications/Notifications/BackupWasSuccessfulNotification.php b/src/Notifications/Notifications/BackupWasSuccessfulNotification.php index 3ff78c58..c101a074 100644 --- a/src/Notifications/Notifications/BackupWasSuccessfulNotification.php +++ b/src/Notifications/Notifications/BackupWasSuccessfulNotification.php @@ -13,8 +13,7 @@ class BackupWasSuccessfulNotification extends BaseNotification { public function __construct( public BackupWasSuccessful $event, - ) { - } + ) {} public function toMail(): MailMessage { diff --git a/src/Notifications/Notifications/CleanupHasFailedNotification.php b/src/Notifications/Notifications/CleanupHasFailedNotification.php index 699c0915..74f3081c 100644 --- a/src/Notifications/Notifications/CleanupHasFailedNotification.php +++ b/src/Notifications/Notifications/CleanupHasFailedNotification.php @@ -13,8 +13,7 @@ class CleanupHasFailedNotification extends BaseNotification { public function __construct( public CleanupHasFailed $event, - ) { - } + ) {} public function toMail(): MailMessage { diff --git a/src/Notifications/Notifications/CleanupWasSuccessfulNotification.php b/src/Notifications/Notifications/CleanupWasSuccessfulNotification.php index 5e6925f1..04b4cb07 100644 --- a/src/Notifications/Notifications/CleanupWasSuccessfulNotification.php +++ b/src/Notifications/Notifications/CleanupWasSuccessfulNotification.php @@ -13,8 +13,7 @@ class CleanupWasSuccessfulNotification extends BaseNotification { public function __construct( public CleanupWasSuccessful $event, - ) { - } + ) {} public function toMail(): MailMessage { diff --git a/src/Notifications/Notifications/HealthyBackupWasFoundNotification.php b/src/Notifications/Notifications/HealthyBackupWasFoundNotification.php index 424adfce..7135e861 100644 --- a/src/Notifications/Notifications/HealthyBackupWasFoundNotification.php +++ b/src/Notifications/Notifications/HealthyBackupWasFoundNotification.php @@ -13,8 +13,7 @@ class HealthyBackupWasFoundNotification extends BaseNotification { public function __construct( public HealthyBackupWasFound $event, - ) { - } + ) {} public function toMail(): MailMessage { diff --git a/src/Notifications/Notifications/UnhealthyBackupWasFoundNotification.php b/src/Notifications/Notifications/UnhealthyBackupWasFoundNotification.php index eacb3ff0..da3840ec 100644 --- a/src/Notifications/Notifications/UnhealthyBackupWasFoundNotification.php +++ b/src/Notifications/Notifications/UnhealthyBackupWasFoundNotification.php @@ -14,8 +14,7 @@ class UnhealthyBackupWasFoundNotification extends BaseNotification { public function __construct( public UnhealthyBackupWasFound $event, - ) { - } + ) {} public function toMail(): MailMessage { diff --git a/src/Tasks/Cleanup/CleanupStrategy.php b/src/Tasks/Cleanup/CleanupStrategy.php index 59d698f9..6a85c751 100644 --- a/src/Tasks/Cleanup/CleanupStrategy.php +++ b/src/Tasks/Cleanup/CleanupStrategy.php @@ -12,8 +12,7 @@ abstract class CleanupStrategy public function __construct( protected Repository $config, - ) { - } + ) {} abstract public function deleteOldBackups(BackupCollection $backups): void; diff --git a/src/Tasks/Cleanup/Period.php b/src/Tasks/Cleanup/Period.php index 6019413e..d00bcb32 100644 --- a/src/Tasks/Cleanup/Period.php +++ b/src/Tasks/Cleanup/Period.php @@ -9,8 +9,7 @@ class Period public function __construct( protected Carbon $startDate, protected Carbon $endDate - ) { - } + ) {} public function startDate(): Carbon { diff --git a/src/Tasks/Monitor/BackupDestinationStatus.php b/src/Tasks/Monitor/BackupDestinationStatus.php index 35387e6f..b79ee544 100644 --- a/src/Tasks/Monitor/BackupDestinationStatus.php +++ b/src/Tasks/Monitor/BackupDestinationStatus.php @@ -15,8 +15,7 @@ class BackupDestinationStatus public function __construct( protected BackupDestination $backupDestination, protected array $healthChecks = [] - ) { - } + ) {} public function backupDestination(): BackupDestination { diff --git a/src/Tasks/Monitor/HealthCheckFailure.php b/src/Tasks/Monitor/HealthCheckFailure.php index ca97fa6a..94d1b0ce 100644 --- a/src/Tasks/Monitor/HealthCheckFailure.php +++ b/src/Tasks/Monitor/HealthCheckFailure.php @@ -10,8 +10,7 @@ class HealthCheckFailure public function __construct( protected HealthCheck $healthCheck, protected Exception $exception - ) { - } + ) {} public function healthCheck(): HealthCheck { diff --git a/src/Tasks/Monitor/HealthChecks/MaximumAgeInDays.php b/src/Tasks/Monitor/HealthChecks/MaximumAgeInDays.php index c25d97bd..0bd33824 100644 --- a/src/Tasks/Monitor/HealthChecks/MaximumAgeInDays.php +++ b/src/Tasks/Monitor/HealthChecks/MaximumAgeInDays.php @@ -10,8 +10,7 @@ class MaximumAgeInDays extends HealthCheck { public function __construct( protected int $days = 1 - ) { - } + ) {} public function checkHealth(BackupDestination $backupDestination): void { diff --git a/src/Tasks/Monitor/HealthChecks/MaximumStorageInMegabytes.php b/src/Tasks/Monitor/HealthChecks/MaximumStorageInMegabytes.php index 2335808a..9a119ed3 100644 --- a/src/Tasks/Monitor/HealthChecks/MaximumStorageInMegabytes.php +++ b/src/Tasks/Monitor/HealthChecks/MaximumStorageInMegabytes.php @@ -10,8 +10,7 @@ class MaximumStorageInMegabytes extends HealthCheck { public function __construct( protected int $maximumSizeInMegaBytes = 5000 - ) { - } + ) {} public function checkHealth(BackupDestination $backupDestination): void {