Completed
Push — master ( 186982...2975e7 )
by Rafael
05:12
created

FieldDefinition::getMaxConcurrentUsage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

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
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 1
    public function getOriginName()
46
    {
47 1
        return $this->originName;
48
    }
49
50
    /**
51
     * @param mixed $originName
52
     */
53 21
    public function setOriginName($originName)
54
    {
55 21
        $this->originName = $originName;
56 21
    }
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 21
    public function setOriginType($originType)
70
    {
71 21
        $this->originType = $originType;
72 21
    }
73
74
    /**
75
     * @return string[]
76
     */
77 1
    public function getInheritedFrom(): array
78
    {
79 1
        return $this->inheritedFrom;
80
    }
81
82
    /**
83
     * @param string $inheritedFrom
84
     */
85 16
    public function addInheritedFrom(string $inheritedFrom): void
86
    {
87 16
        if (!in_array($inheritedFrom, $this->inheritedFrom)) {
88 16
            $this->inheritedFrom[] = $inheritedFrom;
89
        }
90 16
    }
91
92
    /**
93
     * @return int
94
     */
95 2
    public function getMaxConcurrentUsage(): int
96
    {
97 2
        return $this->maxConcurrentUsage;
98
    }
99
100
    /**
101
     * @param int $maxConcurrentUsage
102
     */
103 3
    public function setMaxConcurrentUsage(int $maxConcurrentUsage): void
104
    {
105 3
        $this->maxConcurrentUsage = $maxConcurrentUsage;
106 3
    }
107
}
108