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

ScalarDefinitionNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getExtends() 0 7 2
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