Completed
Push — master ( 14d264...b8b70e )
by Portey
05:01
created

FinalTypesConfigTrait   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A resolve() 0 6 2
1
<?php
2
/**
3
 * Date: 04.12.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Type\Traits;
9
10
use Youshido\GraphQL\Type\Config\Object\InputObjectTypeConfig;
11
use Youshido\GraphQL\Type\Config\Object\ObjectTypeConfig;
12
13
/**
14
 * Class FinalTypesConfigTrait
15
 * @package Youshido\GraphQL\Type\Traits
16
 *
17
 * @method ObjectTypeConfig|InputObjectTypeConfig getConfig()
18
 */
19
trait FinalTypesConfigTrait
20
{
21
22 4
    public function getName()
23
    {
24 4
        return $this->getConfig()->getName();
25
    }
26
27 1
    public function resolve($value = null, $args = [])
28
    {
29 1
        $callable = $this->getConfig()->getResolveFunction();
30
31 1
        return is_callable($callable) ? $callable($value, $args) : null;
32
    }
33
34
}