AbstractFooType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A customField() 0 3 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Fixtures\Types;
5
6
use TheCodingMachine\GraphQL\Controllers\Annotations\Field;
7
use TheCodingMachine\GraphQL\Controllers\Annotations\Right;
8
use TheCodingMachine\GraphQL\Controllers\Annotations\SourceField;
9
use TheCodingMachine\GraphQL\Controllers\Annotations\Type;
10
use TheCodingMachine\GraphQL\Controllers\Fixtures\TestObject;
11
12
/**
13
 * @Type(class=TheCodingMachine\GraphQL\Controllers\Fixtures\TestObject::class)
14
 * @SourceField(name="test")
15
 * @SourceField(name="testBool", logged=true)
16
 * @SourceField(name="testRight", right=@Right(name="FOOBAR"))
17
 */
18
abstract class AbstractFooType
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