getSourceFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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