diff --git a/app/Helpers/BackupEncryption.php b/app/Helpers/BackupEncryption.php index 94d6686ef..b50ab3e92 100644 --- a/app/Helpers/BackupEncryption.php +++ b/app/Helpers/BackupEncryption.php @@ -13,33 +13,33 @@ namespace App\Helpers; -use \ZipArchive; +use ZipArchive; class BackupEncryption { /** - * Default encryption contants + * Default encryption contants. * * @var string */ public const ENCRYPTION_DEFAULT = ZipArchive::EM_AES_128; /** - * AES-128 encryption contants + * AES-128 encryption contants. * * @var string */ public const ENCRYPTION_WINZIP_AES_128 = ZipArchive::EM_AES_128; /** - * AES-192 encryption contants + * AES-192 encryption contants. * * @var string */ public const ENCRYPTION_WINZIP_AES_192 = ZipArchive::EM_AES_192; /** - * AES-256 encryption contants + * AES-256 encryption contants. * * @var string */ diff --git a/app/Helpers/BackupPassword.php b/app/Helpers/BackupPassword.php index bd12dcbb1..fc1732ccf 100644 --- a/app/Helpers/BackupPassword.php +++ b/app/Helpers/BackupPassword.php @@ -14,7 +14,7 @@ namespace App\Helpers; use Illuminate\Support\Collection; -use \ZipArchive; +use ZipArchive; class BackupPassword { @@ -33,16 +33,16 @@ class BackupPassword protected $password; /** - * Read the .zip, apply password and encryption, then rewrite the file + * Read the .zip, apply password and encryption, then rewrite the file. * - * @param string $path + * @param string $path */ public function __construct(string $path) { $this->password = \config('backup.security.password'); // If no password is set, just return the backup-path - if (!$this->password) { + if (! $this->password) { return $this->path = $path; } @@ -54,15 +54,15 @@ class BackupPassword } /** - * Use native PHP ZipArchive + * Use native PHP ZipArchive. * - * @return void + * @return void */ protected function makeZip(string $path): void { $encryption = \config('backup.security.encryption'); - $zipArchive = new ZipArchive; + $zipArchive = new ZipArchive(); $zipArchive->open($path, ZipArchive::OVERWRITE); $zipArchive->addFile($path, 'backup.zip'); diff --git a/app/Listeners/PasswordProtectBackup.php b/app/Listeners/PasswordProtectBackup.php index 1dda62169..aea20c0fe 100644 --- a/app/Listeners/PasswordProtectBackup.php +++ b/app/Listeners/PasswordProtectBackup.php @@ -19,12 +19,13 @@ use Spatie\Backup\Events\BackupZipWasCreated; class PasswordProtectBackup { /** - * Handle the event.s + * Handle the event.s. + * + * @param \Spatie\Backup\Events\BackupZipWasCreated $event * - * @param \Spatie\Backup\Events\BackupZipWasCreated $event * @return string */ - public function handle(BackupZipWasCreated $event) : string + public function handle(BackupZipWasCreated $event): string { return (new BackupPassword($event->pathToZip))->path; }