FakeAnalyzer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Solidifier\Analyzers;
4
5
use Solidifier\VisitableAnalyzer;
6
use Solidifier\Visitor;
7
8
class FakeAnalyzer implements VisitableAnalyzer
9
{
10
    private
11
        $visitors;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $visitors.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
12
    
13
    public function __construct()
14
    {
15
        $this->visitors = array();    
16
    }
17
    
18
    public function addVisitor($traverseName, Visitor $visitor)
19
    {
20
        if(! isset($this->visitors[$traverseName]))
21
        {
22
            $this->visitors[$traverseName] = array();
23
        }
24
        
25
        $this->visitors[$traverseName][] = $visitor;
26
        
27
        return $this;
28
    }
29
    
30
    public function getVisitors()
31
    {
32
        return $this->visitors;
33
    }
34
}