UserObserver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A created() 0 6 1
A deleted() 0 6 1
1
<?php namespace Anomaly\UsersModule\User;
2
3
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
4
use Anomaly\Streams\Platform\Entry\EntryObserver;
5
use Anomaly\UsersModule\User\Event\UserWasCreated;
6
use Anomaly\UsersModule\User\Event\UserWasDeleted;
7
8
/**
9
 * Class UserObserver
10
 *
11
 * @link          http://pyrocms.com/
12
 * @author        PyroCMS, Inc. <[email protected]>
13
 * @author        Ryan Thompson <[email protected]>
14
 */
15
class UserObserver extends EntryObserver
16
{
17
18
    /**
19
     * Fired after a user is created.
20
     *
21
     * @param EntryInterface $entry
22
     */
23
    public function created(EntryInterface $entry)
24
    {
25
        $this->events->fire(new UserWasCreated($entry));
26
27
        parent::created($entry);
28
    }
29
30
    /**
31
     * Fired after a user is deleted.
32
     *
33
     * @param EntryInterface $entry
34
     */
35
    public function deleted(EntryInterface $entry)
36
    {
37
        $this->events->fire(new UserWasDeleted($entry));
38
39
        parent::deleted($entry);
40
    }
41
}
42