Passed
Push — master ( 95d3b3...37ba81 )
by Adrien
07:02
created

Permissions   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Api\Field\Query;
6
7
use Application\Api\Field\FieldInterface;
8
use Application\Api\Output\AllPermissionsType;
9
use GraphQL\Type\Definition\ResolveInfo;
10
use GraphQL\Type\Definition\Type;
11
12
abstract class Permissions implements FieldInterface
13
{
14 3
    public static function build(): array
15
    {
16
        return
17
            [
18 1
                'name' => 'permissions',
19 1
                'type' => Type::nonNull(_types()->get(AllPermissionsType::class)),
20 1
                'description' => 'All permissions for currently logged in user',
21
                'args' => [
22
                ],
23
                'resolve' => function ($root, array $args, $context, ResolveInfo $info) {
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
                'resolve' => function ($root, array $args, /** @scrutinizer ignore-unused */ $context, ResolveInfo $info) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $info is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
                'resolve' => function ($root, array $args, $context, /** @scrutinizer ignore-unused */ ResolveInfo $info) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24 3
                    $contexts = $args;
25
26
                    // Return keys with some dummy data to keep the resolving process going deeper in types
27
                    return [
28 3
                        'crud' => ['contexts' => $contexts],
29
                    ];
30 1
                },
31
            ];
32
    }
33
}
34