Apply fixes from StyleCI

[ci skip] [skip ci]
This commit is contained in:
HDVinnie
2020-12-29 05:20:55 +00:00
committed by StyleCI Bot
parent a3d8d1b975
commit f254bb6fc6
3 changed files with 16 additions and 15 deletions

View File

@@ -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
*/

View File

@@ -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');

View File

@@ -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;
}