Completed
Push — master ( f8a22c...480ba6 )
by ARCANEDEV
12s
created

DetachingRoles::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php namespace Arcanedev\LaravelAuth\Listeners\Permissions;
2
use Arcanedev\LaravelAuth\Events\Permissions\DeletingPermission;
3
4
/**
5
 * Class     DetachingRoles
6
 *
7
 * @package  Arcanedev\LaravelAuth\Listeners\Permissions
8
 * @author   ARCANEDEV <[email protected]>
9
 */
10
class DetachingRoles
11
{
12
    /* -----------------------------------------------------------------
13
     |  Main Methods
14
     | -----------------------------------------------------------------
15
     */
16
17
    /**
18
     * Handle the event.
19
     *
20
     * @param  \Arcanedev\LaravelAuth\Events\Permissions\DeletingPermission  $event
21
     */
22 3
    public function handle(DeletingPermission $event)
23
    {
24 3
        $event->permission->roles()->detach();
25 3
    }
26
}
27