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

FinalTypesConfigTrait::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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
}