Completed
Push — master ( 598945...316866 )
by Kirill
09:09
created

Alternation::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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\Compiler\Grammar\Builder;
11
12
use Railt\Parser\Rule\Rule;
13
use Railt\Parser\Rule\Alternation as AlternationRule;
14
15
/**
16
 * Class Alternation
17
 */
18
class Alternation extends AbstractBuilder
19
{
20
    /**
21
     * @return Rule|AlternationRule
22
     */
23 View Code Duplication
    public function build(): Rule
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
    {
25
        $rule = new AlternationRule($this->name, $this->children, $this->nodeId);
26
        $rule->setDefaultId($this->defaultId);
27
28
        return $rule;
29
    }
30
}
31