UsersModule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A onRegistered() 0 6 2
1
<?php namespace Anomaly\UsersModule;
2
3
use Anomaly\Streams\Platform\Addon\Module\Module;
4
use Anomaly\UsersModule\Role\Command\SetGuestRole;
5
6
/**
7
 * Class UsersModule
8
 *
9
 * @link          http://pyrocms.com/
10
 * @author        PyroCMS, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 */
13
class UsersModule extends Module
14
{
15
16
    /**
17
     * The module icon.
18
     *
19
     * @var string
20
     */
21
    protected $icon = 'users';
22
23
    /**
24
     * The module sections.
25
     *
26
     * @var array
27
     */
28
    protected $sections = [
29
        'users'  => [
30
            'buttons' => [
31
                'new_user',
32
            ],
33
        ],
34
        'roles'  => [
35
            'buttons' => [
36
                'new_role',
37
            ],
38
        ],
39
        'fields' => [
40
            'buttons' => [
41
                'add_field' => [
42
                    'data-toggle' => 'modal',
43
                    'data-target' => '#modal',
44
                    'href'        => 'admin/users/fields/choose',
45
                ],
46
            ],
47
        ],
48
    ];
49
50
    /**
51
     * Fire after the addon registers.
52
     */
53
    public function onRegistered()
54
    {
55
        if ($this->isInstalled()) {
56
            $this->dispatch(new SetGuestRole());
57
        }
58
    }
59
60
}
61