TestInterfaceType::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 5/12/16 4:24 PM
7
*/
8
9
namespace Youshido\Tests\DataProvider;
10
11
12
use Youshido\GraphQL\Type\InterfaceType\AbstractInterfaceType;
13
use Youshido\GraphQL\Type\Scalar\StringType;
14
15
class TestInterfaceType extends AbstractInterfaceType
16
{
17
18
    public function resolveType($object)
19
    {
20
        return is_object($object) ? $object : new TestObjectType();
21
    }
22
23
    public function build($config)
24
    {
25
        $config->addField('name', new StringType());
26
    }
27
28
29
}
30