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 |
||
| 14 | 121 | public function __construct(AuthorizationCheckerInterface $authorizationChecker) |
|
| 15 | { |
||
| 16 | 121 | parent::__construct( |
|
| 17 | 121 | 'hasAnyRole', |
|
| 18 | function ($roles): string { |
||
| 19 | 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); |
|
| 20 | |||
| 21 | 1 | return $code; |
|
| 22 | 121 | }, |
|
| 23 | function ($arguments, $roles) use ($authorizationChecker): bool { |
||
| 24 | return $authorizationChecker->isGranted($roles); |
||
| 25 | 121 | } |
|
| 29 |