LazyInputObjectFields   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 2
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Andi\GraphQL\Common;
6
7
use Andi\GraphQL\Definition\Type\FieldsAwareInterface;
8
use Andi\GraphQL\InputObjectFieldResolver\InputObjectFieldResolverInterface;
9
10
final class LazyInputObjectFields
11
{
12 2
    public function __construct(
13
        private readonly FieldsAwareInterface $fields,
14
        private readonly InputObjectFieldResolverInterface $fieldResolver,
15
    ) {
16 2
    }
17
18 1
    public function __invoke(): iterable
19
    {
20 1
        foreach ($this->fields->getFields() as $field) {
21 1
            yield $this->fieldResolver->resolve($field);
22
        }
23
    }
24
}
25