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 | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 14 | public function __construct($name = 'hasAnyPermission') |
|
| 19 | { |
||
| 20 | 14 | parent::__construct( |
|
| 21 | 14 | $name, |
|
| 22 | 1 | function ($object, $permissions) { |
|
| 23 | 1 | $code = sprintf('array_reduce(%s, function ($isGranted, $permission) use ($container, $object) { return $isGranted || $container->get(\'security.authorization_checker\')->isGranted($permission, %s); }, false)', $permissions, $object); |
|
| 24 | |||
| 25 | 1 | return $code; |
|
| 26 | } |
||
| 27 | 14 | ); |
|
| 28 | 14 | } |
|
| 29 | } |
||
| 30 |