Passed
Push — master ( 3ba489...3505e6 )
by Adrien
11:36
created

Viewer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 11
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 9 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(): array
13
    {
14
        return
15
            [
16 1
                'name' => 'viewer',
17 1
                'type' => _types()->getOutput(User::class),
18 1
                'description' => 'Represents currently logged-in user',
19 1
                'resolve' => function ($root, array $args): ?User {
20
                    return User::getCurrent();
21 1
                },
22
            ];
23
    }
24
}
25