Completed
Pull Request — master (#204)
by Ryan
11:34
created

TestInterfaceType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 4
dl 0
loc 15
rs 10
1
<?php
2
/**
3
 * Copyright (c) 2015–2018 Alexandr Viniychuk <http://youshido.com>.
4
 * Copyright (c) 2015–2018 Portey Vasil <https://github.com/portey>.
5
 * Copyright (c) 2018 Ryan Parman <https://github.com/skyzyx>.
6
 * Copyright (c) 2018 Ashley Hutson <https://github.com/asheliahut>.
7
 * Copyright (c) 2015–2018 Contributors.
8
 *
9
 * http://opensource.org/licenses/MIT
10
 */
11
12
declare(strict_types=1);
13
/*
14
 * This file is a part of GraphQL project.
15
 *
16
 * @author Alexandr Viniychuk <[email protected]>
17
 * created: 5/12/16 4:24 PM
18
 */
19
20
namespace Youshido\Tests\DataProvider;
21
22
use Youshido\GraphQL\Type\InterfaceType\AbstractInterfaceType;
23
use Youshido\GraphQL\Type\Scalar\StringType;
24
25
class TestInterfaceType extends AbstractInterfaceType
26
{
27
    public function resolveType($object)
28
    {
29
        return \is_object($object) ? $object : new TestObjectType();
30
    }
31
32
    public function build($config): void
33
    {
34
        $config->addField('name', new StringType());
35
    }
36
}
37