Completed
Pull Request — master (#19)
by David
02:28 queued 33s
created

TestType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A customField() 0 3 1
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