VariableReducer::reduce()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of Properties 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 Serafim\Properties\Reducers;
11
12
use Railt\Parser\Ast\RuleInterface;
13
14
/**
15
 * Class VariableReducer
16
 */
17
class VariableReducer implements ReducerInterface
18
{
19
    /**
20
     * @param RuleInterface $rule
21
     * @return bool
22
     */
23
    public function match(RuleInterface $rule): bool
24
    {
25
        return $rule->getName() === 'DocBlockVariable';
26
    }
27
28
    /**
29
     * @param RuleInterface $rule
30
     * @return string
31
     */
32
    public function reduce(RuleInterface $rule): string
33
    {
34
        return $rule->getChild(0)->getValue(1);
0 ignored issues
show
Bug introduced by
The method getValue() does not exist on Railt\Parser\Ast\NodeInterface. Did you maybe mean getValues()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
35
    }
36
}
37