Completed
Push — master ( 7510c8...82c7bd )
by Kirill
08:19
created

EnumDefinitionNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEnumValues() 0 10 3
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Compiler\Ast\Definition;
11
12
use Railt\SDL\Compiler\Ast\Dependent\EnumValueDefinitionNode;
13
14
/**
15
 * Class EnumDefinitionNode
16
 */
17
class EnumDefinitionNode extends TypeDefinitionNode
18
{
19
    /**
20
     * @return iterable|EnumValueDefinitionNode[]
21
     */
22
    public function getEnumValues(): iterable
23
    {
24
        $values = $this->first('EnumValues', 1);
25
26
        if ($values) {
27
            foreach ($values as $value) {
0 ignored issues
show
Bug introduced by
The expression $values of type object<Railt\Parser\Ast\NodeInterface> is not traversable.
Loading history...
28
                yield $value;
29
            }
30
        }
31
    }
32
}
33