We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1.0028 |
Changes | 0 |
1 | <?php |
||
13 | 131 | public function __construct(AuthorizationCheckerInterface $authorizationChecker) |
|
14 | { |
||
15 | 131 | parent::__construct( |
|
16 | 131 | 'hasAnyRole', |
|
17 | function ($roles): string { |
||
18 | 1 | $code = \sprintf('array_reduce(%s, function ($isGranted, $role) use (%s) { return $isGranted || $globalVariable->get(\'container\')->get(\'security.authorization_checker\')->isGranted($role); }, false)', $roles, TypeGenerator::USE_FOR_CLOSURES); |
|
19 | |||
20 | 1 | return $code; |
|
21 | 131 | }, |
|
22 | function ($arguments, $roles) use ($authorizationChecker): bool { |
||
23 | return $authorizationChecker->isGranted($roles); |
||
24 | 131 | } |
|
28 |