DetachingPermissions   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 19
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
1
<?php namespace Arcanedev\LaravelAuth\Listeners\Roles;
2
3
use Arcanedev\LaravelAuth\Events\Roles\DeletingRole;
4
5
/**
6
 * Class     DetachingPermissions
7
 *
8
 * @package  Arcanedev\LaravelAuth\Listeners\Roles
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class DetachingPermissions
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Handle the event.
20
     *
21
     * @param  \Arcanedev\LaravelAuth\Events\Roles\DeletingRole  $event
22
     *
23
     * @return boolean
24
     */
25 3
    public function handle(DeletingRole $event)
26
    {
27 3
        $event->role->detachAllPermissions(false);
28 3
    }
29
}
30