UserObserver::created()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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