Completed
Push — master ( 020154...e8c337 )
by Alexandr
02:45
created

ObjectTypeConfig::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 4
Bugs 1 Features 1
Metric Value
c 4
b 1
f 1
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
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
12
use Youshido\GraphQL\Type\AbstractType;
13
use Youshido\GraphQL\Type\Config\Config;
14
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
15
use Youshido\GraphQL\Type\Field\Field;
16
use Youshido\GraphQL\Type\Config\Traits\ArgumentsAwareTrait;
17
use Youshido\GraphQL\Type\Config\Traits\FieldsAwareTrait;
18
use Youshido\GraphQL\Type\Object\ObjectType;
19
use Youshido\GraphQL\Type\TypeMap;
20
21
class ObjectTypeConfig extends Config implements TypeConfigInterface
22
{
23
24
    use FieldsAwareTrait, ArgumentsAwareTrait;
25
26 12
    public function getRules()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        return [
29 12
            'name'        => ['type' => TypeMap::TYPE_STRING, 'required' => true],
30 12
            'description' => ['type' => TypeMap::TYPE_STRING],
31 12
            'fields'      => ['type' => TypeMap::TYPE_ARRAY_OF_FIELDS],
32 12
            'args'        => ['type' => TypeMap::TYPE_ARRAY_OF_INPUTS],
33 12
            'resolve'     => ['type' => TypeMap::TYPE_FUNCTION],
34 12
        ];
35
    }
36
37 13
    protected function build()
38
    {
39 13
        $this->buildFields();
40 13
        $this->buildArguments();
41 13
    }
42
43
}