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

UnionDefinitionNode::getUnitedTypes()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 10
ccs 0
cts 9
cp 0
crap 12
rs 9.9332
c 0
b 0
f 0
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\TypeNameNode;
13
14
/**
15
 * Class UnionDefinitionNode
16
 */
17
class UnionDefinitionNode extends TypeDefinitionNode
18
{
19
    /**
20
     * @return iterable|TypeNameNode[]
21
     */
22
    public function getUnitedTypes(): iterable
23
    {
24
        $unites = $this->first('UnionDefinitionTargets', 1);
25
26
        if ($unites) {
27
            foreach ($unites as $type) {
0 ignored issues
show
Bug introduced by
The expression $unites of type object<Railt\Parser\Ast\NodeInterface> is not traversable.
Loading history...
28
                yield $type;
29
            }
30
        }
31
    }
32
}
33