Total Complexity | 11 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class PermissionConverter |
||
14 | { |
||
15 | public static function getPermissionsForNames(array $names, int $resourceType, ProcessEngineConfiguration $engineConfiguration): array |
||
16 | { |
||
17 | $permissions = []; |
||
18 | |||
19 | for ($i = 0; i < count($names); $i += 1) { |
||
20 | $permissions[] = $engineConfiguration->getPermissionProvider()->getPermissionForName($names[$i], $resourceType); |
||
21 | } |
||
22 | |||
23 | return $permissions; |
||
24 | } |
||
25 | |||
26 | public static function getNamesForPermissions(AuthorizationInterface $authorization, array $permissions): array |
||
54 | } |
||
55 | } |
||
56 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: