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

ObjectTypeConfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 1 Features 1
Metric Value
wmc 2
c 6
b 1
f 1
lcom 0
cbo 3
dl 0
loc 23
ccs 11
cts 11
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRules() 0 10 1
A build() 0 5 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
}