Total Complexity | 6 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
22 | class UserHelper { |
||
23 | |||
24 | /** |
||
25 | * Determine if the connected user entity has roles. |
||
26 | * |
||
27 | * @param mixed|null $user The user. |
||
28 | * @param string|array $roles The role or roles. |
||
29 | * @param bool $or OR ? If true, matches a role cause a break and the method returns true. |
||
30 | * @return bool Returns true in case of success, false otherwise. |
||
31 | */ |
||
32 | public static function hasRoles($user, $roles, bool $or = true): bool { |
||
59 |