Issues (67)

server/Application/Api/Field/Query/Permissions.php (2 issues)

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