Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
17 | 9 | public function getAccessibleSubQuery(?\Ecodev\Felix\Model\User $user): string |
|
18 | { |
||
19 | 9 | if (!$user) { |
|
20 | 1 | return '-1'; |
|
21 | } |
||
22 | |||
23 | 8 | if (in_array($user->getRole(), [User::ROLE_FACILITATOR, User::ROLE_ADMINISTRATOR], true)) { |
|
24 | 3 | return $this->getAllIdsQuery(); |
|
25 | } |
||
26 | |||
27 | 5 | return $this->getAllIdsForOwnerQuery($user); |
|
28 | } |
||
30 |