Passed
Push — master ( 64b758...e85a2d )
by Rafael
08:23
created

FieldDefinition::addInheritedFrom()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
crap 6
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 21
    protected $inheritedFrom = [];
36
37 21
    /**
38
     * @return mixed
39
     */
40
    public function getOriginName()
41
    {
42
        return $this->originName;
43 21
    }
44
45 21
    /**
46 21
     * @param mixed $originName
47
     */
48
    public function setOriginName($originName)
49
    {
50
        $this->originName = $originName;
51 21
    }
52
53 21
    /**
54
     * @return mixed
55
     */
56
    public function getOriginType()
57
    {
58
        return $this->originType;
59 21
    }
60
61 21
    /**
62 21
     * @param mixed $originType
63
     */
64
    public function setOriginType($originType)
65
    {
66
        $this->originType = $originType;
67
    }
68
69
    /**
70
     * @return string[]
71
     */
72
    public function getInheritedFrom(): array
73
    {
74
        return $this->inheritedFrom;
75
    }
76
77
    /**
78
     * @param string $inheritedFrom
79
     */
80
    public function addInheritedFrom(string $inheritedFrom): void
81
    {
82
        if (!in_array($inheritedFrom, $this->inheritedFrom)) {
83
            $this->inheritedFrom[] = $inheritedFrom;
84
        }
85
    }
86
}
87