Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
10 | 7 | public function assignRole(array $currentRoles, RoleInterface $assignRole): array |
|
11 | { |
||
12 | 7 | if ($assignRole->getId() === null) { |
|
13 | 1 | throw new RoleIsNotSavedException; |
|
14 | } |
||
15 | |||
16 | 6 | if (!in_array($assignRole, $currentRoles, true)) { |
|
17 | 6 | $currentRoles[] = $assignRole; |
|
18 | } |
||
19 | |||
20 | 6 | return $currentRoles; |
|
21 | } |
||
22 | |||
61 |