Passed
Push — master ( 46c3ee...445208 )
by Rafael
04:28
created

EnumValueDefinition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 40
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setValue() 0 3 1
A __construct() 0 5 1
A getValue() 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\DefinitionTrait;
14
use Ynlo\GraphQLBundle\Definition\Traits\DeprecateTrait;
15
16
/**
17
 * EnumValueDefinition
18
 */
19
class EnumValueDefinition implements
20
    DefinitionInterface,
21
    DeprecateInterface
22
{
23
    use DefinitionTrait;
24
    use DeprecateTrait;
25
26
    /**
27
     * @var mixed
28
     */
29
    protected $value;
30
31
    /**
32
     * EnumValueDefinition constructor.
33
     *
34
     * @param string $name
35
     * @param string $value
36
     * @param string $description
37
     */
38 1
    public function __construct(string $name = null, string $value = null, string $description = null)
39
    {
40 1
        $this->name = $name;
41 1
        $this->value = $value ?? $name;
42 1
        $this->description = $description;
43 1
    }
44
45
    /**
46
     * @return mixed
47
     */
48
    public function getValue()
49
    {
50
        return $this->value;
51
    }
52
53
    /**
54
     * @param mixed $value
55
     */
56
    public function setValue($value)
57
    {
58
        $this->value = $value;
59
    }
60
}
61