Permissions   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Api\Field\Query;
6
7
use Application\Api\Output\AllPermissionsType;
8
use Ecodev\Felix\Api\Field\FieldInterface;
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(): iterable
15
    {
16 1
        yield 'permissions' => fn () => [
17 1
            'type' => Type::nonNull(_types()->get(AllPermissionsType::class)),
18 1
            'description' => 'All permissions for currently logged in user',
19 1
            'args' => [
20 1
            ],
21 1
            'resolve' => function ($root, array $args, $context, ResolveInfo $info) {
0 ignored issues
show
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

21
            '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...
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

21
            '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...
22 3
                $contexts = $args;
23
24
                // Return keys with some dummy data to keep the resolving process going deeper in types
25 3
                return [
26 3
                    'crud' => ['contexts' => $contexts],
27 3
                ];
28 1
            },
29 1
        ];
30
    }
31
}
32