Completed
Push — master ( c1a156...8cadde )
by Kirill
08:14
created

DescriptionSystem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 6 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\System;
11
12
use Railt\Parser\Ast\RuleInterface;
13
use Railt\Reflection\AbstractTypeDefinition;
14
use Railt\Reflection\Contracts\Definition;
15
use Railt\SDL\Ast\ProvidesDescription;
16
17
/**
18
 * Class DescriptionSystem
19
 */
20
class DescriptionSystem extends System
21
{
22
    /**
23
     * @param Definition $definition
24
     * @param RuleInterface $ast
25
     */
26 119
    public function resolve(Definition $definition, RuleInterface $ast): void
27
    {
28 119
        if ($definition instanceof AbstractTypeDefinition && $ast instanceof ProvidesDescription) {
29 119
            $definition->withDescription($ast->getDescription());
30
        }
31 119
    }
32
}
33