Completed
Push — master ( 2975e7...46c3ee )
by Rafael
07:49
created

EnumDefinition   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 26
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getValues() 0 3 1
A addValue() 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\ClassAwareDefinitionTrait;
14
use Ynlo\GraphQLBundle\Definition\Traits\DefinitionTrait;
15
16
/**
17
 * EnumDefinition
18
 */
19
class EnumDefinition implements
20
    DefinitionInterface,
21
    ClassAwareDefinitionInterface
22
{
23
    use DefinitionTrait;
24
    use ClassAwareDefinitionTrait;
25
26
    /**
27
     * @var EnumValueDefinition[]
28
     */
29
    protected $values;
30
31
    /**
32
     * @return EnumValueDefinition[]
33
     */
34 1
    public function getValues(): array
35
    {
36 1
        return $this->values;
37
    }
38
39
    /**
40
     * @param EnumValueDefinition $definition
41
     */
42 1
    public function addValue(EnumValueDefinition $definition)
43
    {
44 1
        $this->values[$definition->getName()] = $definition;
45 1
    }
46
}
47