TestType::customField()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Fixtures;
5
6
use TheCodingMachine\GraphQL\Controllers\Annotations\Right;
7
use TheCodingMachine\GraphQL\Controllers\Annotations\SourceField;
8
use TheCodingMachine\GraphQL\Controllers\Annotations\Field;
9
use TheCodingMachine\GraphQL\Controllers\Annotations\Type;
10
11
/**
12
 * @Type(class=TestObject::class)
13
 * @SourceField(name="test")
14
 * @SourceField(name="testBool", logged=true)
15
 * @SourceField(name="testRight", right=@Right(name="FOOBAR"))
16
 * @SourceField(name="sibling")
17
 */
18
class TestType
19
{
20
    /**
21
     * @Field()
22
     * @param TestObject $test
23
     * @param string $param
24
     * @return string
25
     */
26
    public function customField(TestObject $test, string $param = 'foo'): string
27
    {
28
        return $test->getTest().$param;
29
    }
30
}
31