Completed
Push — master ( cd12e3...3d9bc0 )
by Kévin
02:40
created

ParameterCollectorVisitor::getCompilationData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace RulerZ\Visitor;
4
5
use Hoa\Ruler\Model as AST;
6
use RulerZ\Model;
7
8 View Code Duplication
class ParameterCollectorVisitor extends Visitor
0 ignored issues
show
Duplication introduced by
This class 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...
9
{
10
    /**
11
     * @var array
12
     */
13
    private $parameters = [];
14
15
    /**
16
     * {@inheritDoc}
17
     */
18
    public function getCompilationData()
19
    {
20
        return [
21
            'parameters' => $this->parameters,
22
        ];
23
    }
24
25
    /**
26
     * {@inheritDoc}
27
     */
28
    public function visitParameter(Model\Parameter $element, &$handle = null, $eldnah = null)
29
    {
30
        $this->parameters[$element->getName()] = $element;
31
    }
32
33
    /**
34
     * {@inheritDoc}
35
     */
36
    public function visitModel(AST\Model $element, &$handle = null, $eldnah = null)
37
    {
38
        parent::visitModel($element, $handle, $eldnah);
39
40
        return $this->parameters;
41
    }
42
}
43