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

FoundUseNamespace::withError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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