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

OffsetSystem::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
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\AbstractDefinition;
14
use Railt\Reflection\Contracts\Definition;
15
16
/**
17
 * Class OffsetSystem
18
 */
19
class OffsetSystem extends System
20
{
21
    /**
22
     * @param Definition $definition
23
     * @param RuleInterface $ast
24
     */
25 119
    public function resolve(Definition $definition, RuleInterface $ast): void
26
    {
27 119
        if ($definition instanceof AbstractDefinition) {
28 119
            $definition->withOffset($ast->getOffset());
29
        }
30 119
    }
31
}
32