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

DescriptionSystem::resolve()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 2
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 3
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\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