Test Failed
Push — master ( a0eed4...bb00ac )
by Kirill
149:40
created

UnionDefinitionNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUnionDefinitions() 0 8 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\Frontend\AST\Definition;
11
12
/**
13
 * Class UnionDefinitionNode
14
 */
15
class UnionDefinitionNode extends TypeDefinitionNode
16
{
17
    /**
18
     * @return iterable|string[]
19
     */
20
    public function getUnionDefinitions(): iterable
21
    {
22
        if ($targets = $this->first('UnionDefinitionTargets', 1)) {
23
            foreach ($targets as $target) {
0 ignored issues
show
Bug introduced by
The expression $targets of type object<Railt\Parser\Ast\NodeInterface> is not traversable.
Loading history...
24
                yield $target->getChild(0)->getValue();
25
            }
26
        }
27
    }
28
}
29