Viewer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Api\Field\Query;
6
7
use Application\Model\User;
8
use Ecodev\Felix\Api\Field\FieldInterface;
9
10
abstract class Viewer implements FieldInterface
11
{
12 2
    public static function build(): iterable
13
    {
14 1
        yield 'viewer' => fn () => [
15 2
            'type' => _types()->getOutput(User::class),
16 2
            'description' => 'Represents currently logged-in user',
17 2
            'resolve' => fn ($root, array $args): ?User => User::getCurrent(),
0 ignored issues
show
Unused Code introduced by
The parameter $root 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

17
            'resolve' => fn (/** @scrutinizer ignore-unused */ $root, array $args): ?User => User::getCurrent(),

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 $args 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

17
            'resolve' => fn ($root, /** @scrutinizer ignore-unused */ array $args): ?User => User::getCurrent(),

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...
18 2
        ];
19
    }
20
}
21