Completed
Push — master ( 552805...97be4b )
by Portey
03:57
created

Field::getDescription()   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: 27.11.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Type\Field;
9
10
11
use Youshido\GraphQL\Type\Config\Field\FieldConfig;
12
13
class Field
14
{
15
16
    /** @var FieldConfig */
17
    protected $config;
18
19 7
    public function __construct($config)
20
    {
21 7
        $this->config = new FieldConfig($config);
22 7
    }
23
24
    /**
25
     * @return string
26
     */
27 3
    public function getName()
28
    {
29 3
        return $this->config->getName();
30
    }
31
32 5
    public function getType()
33
    {
34 5
        return $this->config->getType();
35
    }
36
37
    /**
38
     * @return FieldConfig
39
     */
40 4
    public function getConfig()
41
    {
42 4
        return $this->config;
43
    }
44
45
    //todo: rethink logic below
46
47 1
    public function getIsDeprecated()
48
    {
49 1
        return $this->getConfig()->get('isDeprecated', false);
50
    }
51
52 1
    public function getDeprecationReason()
53
    {
54 1
        return $this->getConfig()->get('deprecationReason', null);
55
    }
56
57 1
    public function getDescription()
58
    {
59 1
        return $this->getConfig()->get('deprecationReason', null);
60
    }
61
}