Viewer::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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 1
    public static function build(): iterable
13
    {
14 1
        yield 'viewer' => fn () => [
15 1
            'type' => _types()->getOutput(User::class),
16 1
            'description' => 'Represents currently logged-in user',
17 1
            'resolve' => fn ($root, array $args): ?User => User::getCurrent(),
18 1
        ];
19
    }
20
}
21