| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function getGroups($userId) |
||
| 34 | { |
||
| 35 | if (!is_array($this->userGroups)) { |
||
| 36 | return []; |
||
| 37 | } |
||
| 38 | |||
| 39 | $memberOf = []; |
||
| 40 | foreach ($this->userGroups as $groupId => $groupMembers) { |
||
| 41 | if (!is_array($groupMembers)) { |
||
| 42 | continue; |
||
| 43 | } |
||
| 44 | if (in_array($userId, $groupMembers)) { |
||
| 45 | $memberOf[] = $groupId; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | return $memberOf; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |