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 | 130 | public function __construct(AuthorizationCheckerInterface $authorizationChecker, $name = 'hasAnyPermission') |
|
| 14 | { |
||
| 15 | 130 | parent::__construct( |
|
| 16 | 130 | $name, |
|
| 17 | function ($object, $permissions) { |
||
| 18 | 1 | $code = \sprintf('array_reduce(%s, function ($isGranted, $permission) use (%s, $object) { return $isGranted || $globalVariable->get(\'container\')->get(\'security.authorization_checker\')->isGranted($permission, %s); }, false)', $permissions, TypeGenerator::USE_FOR_CLOSURES, $object); |
|
| 19 | |||
| 20 | 1 | return $code; |
|
| 21 | 130 | }, |
|
| 22 | function ($arguments, $object, $permissions) use ($authorizationChecker) { |
||
| 23 | return $authorizationChecker->isGranted($permissions, $object); |
||
| 24 | 130 | } |
|
| 28 |