SetGuestRole   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
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 16
c 2
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
1
<?php namespace Anomaly\UsersModule\Role\Command;
2
3
use Anomaly\Streams\Platform\Support\Authorizer;
4
use Anomaly\UsersModule\Role\Contract\RoleRepositoryInterface;
5
6
7
/**
8
 * Class SetGuestRole
9
 *
10
 * @link          http://pyrocms.com/
11
 * @author        PyroCMS, Inc. <[email protected]>
12
 * @author        Ryan Thompson <[email protected]>
13
 */
14
class SetGuestRole
15
{
16
17
    /**
18
     * Handle the command.
19
     *
20
     * @param RoleRepositoryInterface $roles
21
     * @param Authorizer              $authorizer
22
     */
23
    public function handle(RoleRepositoryInterface $roles, Authorizer $authorizer)
24
    {
25
        if ($guest = $roles->findBySlug('guest')) {
26
            $authorizer->setGuest($guest);
27
        }
28
    }
29
}
30