Completed
Push — master ( 4dd992...7f3992 )
by Cheren
04:17
created

UserEventHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A implementedEvents() 0 7 1
A onAdminAddAfterSave() 0 3 1
A onAdminAddBeforeSave() 0 3 1
1
<?php
2
/**
3
 * CakeCMS Community
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package     Community
10
 * @license     MIT
11
 * @copyright   MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link        https://github.com/CakeCMS/Community".
13
 * @author      Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Community\Event;
17
18
use Cake\Event\Event;
19
use Cake\Event\EventListenerInterface;
20
21
/**
22
 * Class UserEventHandler
23
 *
24
 * @package Community\Event
25
 */
26
class UserEventHandler implements EventListenerInterface
27
{
28
29
    /**
30
     * Returns a list of events this object is implementing.
31
     *
32
     * @return array
33
     */
34
    public function implementedEvents()
35
    {
36
        return [
37
            'Admin.Controller.User.Add.BeforeSave' => 'onAdminAddBeforeSave',
38
            'Admin.Controller.User.Add.AfterSave'  => 'onAdminAddAfterSave',
39
        ];
40
    }
41
42
    /**
43
     * On add user after save (ADMIN).
44
     *
45
     * @param Event $event
46
     */
47
    public function onAdminAddAfterSave(Event $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event 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...
48
    {
49
    }
50
51
    /**
52
     * On add user before save (ADMIN).
53
     *
54
     * @param Event $event
55
     */
56
    public function onAdminAddBeforeSave(Event $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event 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...
57
    {
58
    }
59
}
60