Completed
Push — master ( df309f...9e12f0 )
by Rafael
08:32
created

FieldDefinition::getMaxConcurrentUsage()   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
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 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 int
34
     */
35
    protected $maxConcurrentUsage = 0;
36
37
    /**
38
     * @var string[]
39
     */
40
    protected $inheritedFrom = [];
41
42
    /**
43
     * @return mixed
44
     */
45 33
    public function getOriginName()
46
    {
47 33
        return $this->originName;
48
    }
49
50
    /**
51
     * @param mixed $originName
52
     */
53 81
    public function setOriginName($originName)
54
    {
55 81
        $this->originName = $originName;
56 81
    }
57
58
    /**
59
     * @return mixed
60
     */
61 1
    public function getOriginType()
62
    {
63 1
        return $this->originType;
64
    }
65
66
    /**
67
     * @param mixed $originType
68
     */
69 37
    public function setOriginType($originType)
70
    {
71 37
        $this->originType = $originType;
72 37
    }
73
74
    /**
75
     * @return string[]
76
     */
77 32
    public function getInheritedFrom(): array
78
    {
79 32
        return $this->inheritedFrom;
80
    }
81
82
    /**
83
     * @param string[] $inheritedFrom
84
     */
85 32
    public function setInheritedFrom(array $inheritedFrom): void
86
    {
87 32
        $this->inheritedFrom = $inheritedFrom;
88 32
    }
89
90
    /**
91
     * @param string $inheritedFrom
92
     */
93 32
    public function addInheritedFrom(string $inheritedFrom): void
94
    {
95 32
        if (!\in_array($inheritedFrom, $this->inheritedFrom)) {
96 32
            $this->inheritedFrom[] = $inheritedFrom;
97
        }
98 32
    }
99
100
    /**
101
     * @return int
102
     */
103 2
    public function getMaxConcurrentUsage(): int
104
    {
105 2
        return $this->maxConcurrentUsage;
106
    }
107
108
    /**
109
     * @param int $maxConcurrentUsage
110
     */
111 3
    public function setMaxConcurrentUsage(int $maxConcurrentUsage): void
112
    {
113 3
        $this->maxConcurrentUsage = $maxConcurrentUsage;
114 3
    }
115
}
116