Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#536)
by
unknown
19:46
created

HasAnyPermission   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 13
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction\Security;
6
7
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction;
8
use Overblog\GraphQLBundle\Generator\TypeGenerator;
9
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
10
11
final class HasAnyPermission extends ExpressionFunction
12
{
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
            }
25
        );
26 130
    }
27
}
28