Completed
Push — master ( ec2395...0dfd17 )
by Sherif
02:09
created

AclGroupObserver::restoring()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php namespace App\Modules\Groups\ModelObservers;
2
3
/**
4
 * Handling of model events,
5
 */
6
class AclGroupObserver
7
{
8
9
    public function saving($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
10
    {
11
        //
12
    }
13
14
    public function saved($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        //
17
    }
18
19
    public function creating($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
    {
21
        //
22
    }
23
24
    public function created($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        //
27
    }
28
29
    /**
30
     * Prevent updating of the admin group.
31
     *
32
     * @param  object $model the model beign updated.
33
     * @return void
34
     */
35
    public function updating($model)
36
    {
37
        if ($model->getOriginal('name') == 'Admin') {
38
            \ErrorHandler::noPermissions();
39
        }
40
    }
41
42
    public function updated($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
43
    {
44
        //
45
    }
46
47
    /**
48
     * Prevent deleting the admin group.
49
     *
50
     * @param  object $model the delted model.
51
     * @return void
52
     */
53
    public function deleting($model)
54
    {
55
        if ($model->getOriginal('name') == 'Admin') {
56
            \ErrorHandler::noPermissions();
57
        }
58
    }
59
60
    public function deleted($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
    {
62
        //
63
    }
64
65
    public function restoring($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
66
    {
67
        //
68
    }
69
70
    public function restored($model)
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
71
    {
72
        //
73
    }
74
}
75