PasswordProtectZip   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 2 1
1
<?php
2
3
namespace Olssonm\BackupShield\Listeners;
4
5
use Olssonm\BackupShield\Factories\Password;
6
7
use Spatie\Backup\Events\BackupZipWasCreated;
8
9
class PasswordProtectZip
10
{
11
    /**
12
     * Create the event listener.
13
     *
14
     * @return void
15
     */
16
    public function __construct()
17
    {
18
        //
19
    }
20
21
    /**
22
     * Handle the event.
23
     *
24
     * @param  \Spatie\Backup\Events\BackupZipWasCreated  $event
25
     * @return string
26
     */
27
    public function handle(BackupZipWasCreated $event) : string
28
    {
29
        return (new Password($event->pathToZip))->path;
30
    }
31
}
32