TestTypeWithSourceFieldInterface   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSourceFields() 0 4 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Fixtures;
5
6
use TheCodingMachine\GraphQL\Controllers\Annotations\SourceField;
7
use TheCodingMachine\GraphQL\Controllers\Annotations\SourceFieldInterface;
8
use TheCodingMachine\GraphQL\Controllers\Annotations\Type;
9
use TheCodingMachine\GraphQL\Controllers\FromSourceFieldsInterface;
10
11
/**
12
 * @Type(class=TestObject::class)
13
 */
14
class TestTypeWithSourceFieldInterface implements FromSourceFieldsInterface
15
{
16
    /**
17
     * Dynamically returns the array of source fields to be fetched from the original object.
18
     *
19
     * @return SourceFieldInterface[]
20
     */
21
    public function getSourceFields(): array
22
    {
23
        return [
24
            new SourceField(['name'=>'test']),
25
        ];
26
    }
27
}
28