Completed
Push — master ( 7228f1...d8197d )
by Kévin
02:29
created

ParameterCollectorVisitor::visitParameter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace RulerZ\Visitor;
4
5
use Hoa\Ruler\Model as AST;
6
use RulerZ\Model;
7
8
class ParameterCollectorVisitor extends Visitor
9
{
10
    /**
11
     * @var array
12
     */
13
    private $parameters = [];
14
15
    /**
16
     * {@inheritDoc}
17
     */
18
    public function visitParameter(Model\Parameter $element, &$handle = null, $eldnah = null)
19
    {
20
        $this->parameters[$element->getName()] = $element;
21
    }
22
23
    /**
24
     * {@inheritDoc}
25
     */
26
    public function visitModel(AST\Model $element, &$handle = null, $eldnah = null)
27
    {
28
        parent::visitModel($element, $handle, $eldnah);
29
30
        return $this->parameters;
31
    }
32
}
33