WebonyxInputObjectFieldMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Andi\GraphQL\InputObjectFieldResolver\Middleware;
6
7
use Andi\GraphQL\InputObjectFieldResolver\InputObjectFieldResolverInterface;
8
use GraphQL\Type\Definition as Webonyx;
9
10
final class WebonyxInputObjectFieldMiddleware implements MiddlewareInterface
11
{
12
    public const PRIORITY = 1024;
13
14 2
    public function process(mixed $field, InputObjectFieldResolverInterface $fieldResolver): Webonyx\InputObjectField
15
    {
16 2
        return $field instanceof Webonyx\InputObjectField
17 1
            ? $field
18 2
            : $fieldResolver->resolve($field);
19
    }
20
}
21