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

FieldDefinition::setOriginName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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