1 | <?php namespace Distilleries\Expendable\Helpers; |
||
6 | class UserUtils |
||
7 | { |
||
8 | |||
9 | 4 | ||
10 | public static function isBackendRole() |
||
18 | |||
19 | 88 | public static function frontendInitialRole() |
|
25 | |||
26 | 12 | public static function isFrontendRole() |
|
34 | |||
35 | 12 | ||
36 | |||
37 | 12 | public static function get() |
|
41 | |||
42 | 16 | public static function getEmail() |
|
46 | |||
47 | 8 | public static function getDisplayName() |
|
51 | 8 | ||
52 | public static function isNotSuperAdmin() |
||
56 | 344 | ||
57 | |||
58 | public static function setArea($area) |
||
62 | 12 | ||
63 | public static function getArea() |
||
67 | 12 | ||
68 | public static function forgotArea() |
||
72 | 12 | ||
73 | 4 | public static function hasAccess($key) |
|
81 | |||
82 | 16 | public static function hasDisplayAllStatus() |
|
86 | 16 | ||
87 | 12 | public static function forgotDisplayAllStatus() |
|
91 | 8 | ||
92 | public static function setDisplayAllStatus() |
||
96 | |||
97 | public static function setIsLoggedIn() |
||
107 | |||
108 | public static function forgotIsLoggedIn() |
||
118 | |||
119 | public static function securityCheckLockEnabled() |
||
123 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: