Total Complexity | 7 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Coverage | 95% |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Distilleries\Expendable\Listeners; |
||
7 | class UserListener extends BaseListener |
||
|
|||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var array[ |
||
12 | * 'user.login'=>[ |
||
13 | * 'action'=>'handleLogin', |
||
14 | * 'priority'=>0 |
||
15 | * ] |
||
16 | * ] |
||
17 | * |
||
18 | */ |
||
19 | protected $events = [ |
||
20 | 'user.login' => [ |
||
21 | 'action' => 'handleLogin', |
||
22 | 'priority' => 0, |
||
23 | ], |
||
24 | 'user.logout' => [ |
||
25 | 'action' => 'handleLogOut', |
||
26 | 'priority' => 0, |
||
27 | ], |
||
28 | 'user.security' => [ |
||
29 | 'action' => 'handleLockIncrement', |
||
30 | 'priority' => 0, |
||
31 | ] |
||
32 | ]; |
||
33 | |||
34 | 8 | public function handleLogin(LockableContract $model) |
|
35 | { |
||
36 | |||
37 | |||
38 | 8 | if ($model->email != '') { |
|
39 | 4 | $model->unlock(); |
|
40 | } |
||
41 | |||
42 | 8 | $areaServices = []; |
|
43 | |||
44 | 8 | $role = $model->role; |
|
45 | |||
46 | 8 | if (!empty($role)) |
|
47 | { |
||
48 | 4 | foreach ($model->role->permissions as $permission) |
|
49 | { |
||
50 | 4 | $areaServices[] = $permission->service->action; |
|
51 | } |
||
52 | |||
53 | } |
||
54 | |||
55 | |||
56 | 8 | UserUtils::setArea($areaServices); |
|
57 | 8 | UserUtils::setIsLoggedIn(); |
|
58 | 8 | UserUtils::setDisplayAllStatus(); |
|
59 | |||
60 | } |
||
61 | |||
62 | 8 | public function handleLogOut() |
|
63 | { |
||
64 | 8 | UserUtils::forgotArea(); |
|
65 | 8 | UserUtils::forgotIsLoggedIn(); |
|
66 | 8 | UserUtils::forgotDisplayAllStatus(); |
|
67 | |||
68 | |||
69 | } |
||
70 | |||
71 | 2 | public function handleLockIncrement($email) |
|
79 | } |
||
80 | } |
||
81 | } |
||
82 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths