Completed
Push — master ( 3a14e9...fe7442 )
by Portey
04:17
created

MutationType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 14
ccs 3
cts 4
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 9 2
1
<?php
2
/**
3
 * Date: 03.12.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Introspection;
9
10
use Youshido\GraphQL\Schema;
11
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
12
use Youshido\GraphQL\Type\Field\Field;
13
use Youshido\GraphQL\Type\Object\AbstractObjectType;
14
15
class MutationType extends QueryType
16
{
17
18 1
    public function resolve($value = null, $args = [])
19
    {
20
        /** @var Schema|Field $value */
21 1
        if ($value instanceof Schema) {
22 1
            return $value->getMutationType();
23
        }
24
25
        return $value->getConfig()->getType();
26
    }
27
28
}