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

ParameterCollectorVisitor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A visitParameter() 0 4 1
A visitModel() 0 6 1
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