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

Field   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 7
c 4
b 0
f 1
lcom 1
cbo 1
dl 0
loc 49
ccs 15
cts 15
cp 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A getType() 0 4 1
A getConfig() 0 4 1
A getIsDeprecated() 0 4 1
A getDeprecationReason() 0 4 1
A getDescription() 0 4 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
}