Completed
Push — master ( acc9c4...a30c3e )
by BruceScrutinizer
06:36
created

FoundUseNamespace   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getNodeName() 0 3 1
A __construct() 0 4 1
A foundError() 0 3 1
A getLine() 0 3 1
A withError() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace NamespaceProtector\Parser\Node\Event;
4
5
class FoundUseNamespace implements EventProcessNodeInterface
6
{
7
    /** @var int */
8
    private $line;
9
10
    /** @var string */
11
    private $nodeName;
12
13
    /** @var bool */
14
    private $erroDetect = false;
15
16
    public function __construct(int $line, string $nodeName)
17
    {
18
        $this->line = $line;
19
        $this->nodeName = $nodeName;
20
    }
21
22
    public function getLine(): int
23
    {
24
        return $this->line;
25
    }
26
27
    public function getNodeName(): string
28
    {
29
        return $this->nodeName;
30
    }
31
32
    public function foundError(): void
33
    {
34
        $this->erroDetect = true;
35
    }
36
37
    public function withError(): bool
38
    {
39
        return $this->erroDetect;
40
    }
41
}
42