Completed
Push — master ( 392340...6e5734 )
by Sherif
07:20
created

SettingsObserver::restored()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php namespace App\Modules\V1\Core\ModelObservers;
2
3
/**
4
 * Handling of model events,
5
 */
6
class SettingsObserver {
7
8
    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...
9
    {
10
        //
11
    }
12
13
    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...
14
    {
15
        //
16
    }
17
18
    /**
19
     * Prevent the creating of the settings.
20
     * 
21
     * @param  object $model the model beign created.
22
     * @return void
23
     */
24
    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...
25
    {
26
        \ErrorHandler::cannotCreateSetting();
27
    }
28
29
    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...
30
    {
31
        //
32
    }
33
34
    /**
35
     * Prevent updating of the setting key.
36
     * 
37
     * @param  object $model the model beign updated.
38
     * @return void
39
     */
40
    public function updating($model)
41
    {
42
        if ($model->getOriginal('key') !== $model->key) 
43
        {
44
            \ErrorHandler::cannotUpdateSettingKey();
45
        }
46
    }
47
48
    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...
49
    {
50
        //
51
    }
52
53
    public function deleting($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...
54
    {
55
        //
56
    }
57
58
    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...
59
    {
60
        //
61
    }
62
63
    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...
64
    {
65
        //
66
    }
67
68
    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...
69
    {
70
        //
71
    }
72
}