Completed
Push — master ( f9f0ef...24a695 )
by Portey
05:15
created

ObjectTypeConfig::getInterfaces()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
* This file is a part of graphql-youshido project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 11/27/15 2:32 AM
7
*/
8
9
namespace Youshido\GraphQL\Type\Config\Object;
10
11
use Youshido\GraphQL\Type\Config\Config;
12
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
13
use Youshido\GraphQL\Type\Config\Traits\ArgumentsAwareTrait;
14
use Youshido\GraphQL\Type\Config\Traits\FieldsAwareTrait;
15
use Youshido\GraphQL\Type\TypeMap;
16
17
class ObjectTypeConfig extends Config implements TypeConfigInterface
18
{
19
20
    use FieldsAwareTrait, ArgumentsAwareTrait;
21
22 23
    public function getRules()
23
    {
24
        return [
25 23
            'name'        => ['type' => TypeMap::TYPE_STRING, 'required' => true],
26 23
            'description' => ['type' => TypeMap::TYPE_STRING],
27 23
            'fields'      => ['type' => TypeMap::TYPE_ARRAY_OF_FIELDS],
28 23
            'args'        => ['type' => TypeMap::TYPE_ARRAY_OF_INPUTS],
29 23
            'resolve'     => ['type' => TypeMap::TYPE_FUNCTION],
30 23
            'interfaces'  => ['type' => TypeMap::TYPE_ARRAY_OF_INTERFACES]
31 23
        ];
32
    }
33
34 25
    protected function build()
35
    {
36 25
        $this->buildFields();
37 25
        $this->buildArguments();
38 25
    }
39
40 4
    public function getInterfaces()
41
    {
42 4
        return $this->get('interfaces', []);
43
    }
44
45
}