Completed
Push — master ( ed70fa...5a4e4f )
by Portey
03:04
created

MutationType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 0
cbo 4
dl 0
loc 14
ccs 0
cts 4
cp 0
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\Definition;
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
    public function resolve($value = null, $args = [])
19
    {
20
        /** @var Schema|Field  $value */
21
        if($value instanceof Schema){
22
            return $value->getMutationType();
23
        }
24
25
        return $value->getConfig()->getType();
26
    }
27
28
}