Passed
Push — master ( e85a2d...ea8174 )
by Rafael
07:43
created

FieldDefinition   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
c 0
b 0
f 0
dl 0
loc 66
ccs 15
cts 15
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setOriginType() 0 3 1
A getOriginType() 0 3 1
A addInheritedFrom() 0 4 2
A getOriginName() 0 3 1
A getInheritedFrom() 0 3 1
A setOriginName() 0 3 1
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Definition;
12
13
use Ynlo\GraphQLBundle\Definition\Traits\ExecutableDefinitionTrait;
14
15
/**
16
 * Class FieldDefinition
17
 */
18
class FieldDefinition implements ExecutableDefinitionInterface
19
{
20
    use ExecutableDefinitionTrait;
21
22
    /**
23
     * @var string
24
     */
25
    protected $originName;
26
27
    /**
28
     * @var string
29
     */
30
    protected $originType;
31
32
    /**
33
     * @var string[]
34
     */
35
    protected $inheritedFrom = [];
36
37
    /**
38
     * @return mixed
39
     */
40 21
    public function getOriginName()
41
    {
42 21
        return $this->originName;
43
    }
44
45
    /**
46
     * @param mixed $originName
47
     */
48 21
    public function setOriginName($originName)
49
    {
50 21
        $this->originName = $originName;
51 21
    }
52
53
    /**
54
     * @return mixed
55
     */
56 21
    public function getOriginType()
57
    {
58 21
        return $this->originType;
59
    }
60
61
    /**
62
     * @param mixed $originType
63
     */
64 21
    public function setOriginType($originType)
65
    {
66 21
        $this->originType = $originType;
67 21
    }
68
69
    /**
70
     * @return string[]
71
     */
72 21
    public function getInheritedFrom(): array
73
    {
74 21
        return $this->inheritedFrom;
75
    }
76
77
    /**
78
     * @param string $inheritedFrom
79
     */
80 21
    public function addInheritedFrom(string $inheritedFrom): void
81
    {
82 21
        if (!in_array($inheritedFrom, $this->inheritedFrom)) {
83 21
            $this->inheritedFrom[] = $inheritedFrom;
84
        }
85 21
    }
86
}
87