LazyObjectFields::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 0
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 1
cts 1
cp 1
crap 1
rs 10
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\ObjectFieldResolver\ObjectFieldResolverInterface;
9
10
final class LazyObjectFields
11
{
12 2
    public function __construct(
13
        private readonly FieldsAwareInterface $fields,
14
        private readonly ObjectFieldResolverInterface $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