Completed
Push — master ( 8afd90...4bf010 )
by Kirill
03:48
created

ScalarDefinitionNode::getExtends()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 6
rs 10
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\Parser\Ast\RuleInterface;
13
use Railt\SDL\Compiler\Ast\TypeNameNode;
14
15
/**
16
 * Class ScalarDefinitionNode
17
 */
18
class ScalarDefinitionNode extends TypeDefinitionNode
19
{
20
    /**
21
     * @return null|TypeNameNode
22
     */
23
    public function getExtends(): ?TypeNameNode
24
    {
25
        /** @var RuleInterface $extends */
26
        $extends = $this->first('Extends', 1);
27
28
        return $extends ? $extends->getChild(0) : null;
29
    }
30
}
31