| Conditions | 7 |
| Paths | 8 |
| Total Lines | 26 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 7 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | 4 | public function enterNode(Node $node): void |
|
| 41 | { |
||
| 42 | 4 | $name = null; |
|
| 43 | |||
| 44 | 4 | if ($node instanceof Name) { |
|
| 45 | 4 | $name = $node->toString(); |
|
| 46 | } |
||
| 47 | |||
| 48 | 4 | if ($name === null |
|
| 49 | 4 | || (array_key_exists($name, $this->symbols) |
|
| 50 | 2 | && $this->symbols[$name] === false |
|
| 51 | ) |
||
| 52 | ) { |
||
| 53 | 1 | return; |
|
| 54 | } |
||
| 55 | |||
| 56 | 4 | if (!$this->filter->__invoke($name)) { |
|
| 57 | 2 | $this->symbols[$name] = false; |
|
| 58 | 2 | return; |
|
| 59 | } |
||
| 60 | |||
| 61 | 2 | if (!array_key_exists($name, $this->symbols)) { |
|
| 62 | 2 | $this->symbols[$name] = []; |
|
| 63 | } |
||
| 64 | |||
| 65 | 2 | $this->symbols[$name][] = $node; |
|
| 66 | 2 | } |
|
| 85 |