Completed
Pull Request — master (#19)
by David
03:53
created

TestType::customField()   A

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\AbstractAnnotatedObjectType;
7
use TheCodingMachine\GraphQL\Controllers\Annotations\Field;
8
use TheCodingMachine\GraphQL\Controllers\Registry\Registry;
9
use TheCodingMachine\GraphQL\Controllers\Registry\RegistryInterface;
10
use Youshido\GraphQL\Config\Object\ObjectTypeConfig;
11
use Youshido\GraphQL\Type\Object\AbstractObjectType;
12
13
class TestType extends AbstractAnnotatedObjectType
14
{
15
    public function __construct(RegistryInterface $registry)
16
    {
17
        parent::__construct($registry);
18
    }
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