Completed
Push — master ( 8aa9dc...da896c )
by BruceScrutinizer
06:41
created

FoundUseNamespace   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 44
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getNodeName() 0 3 1
A getAdditionalInformation() 0 3 1
A __construct() 0 4 1
A foundError() 0 4 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
final class FoundUseNamespace implements EventProcessNodeInterface
6
{
7
    /** @var int */
8
    private $line;
9
10
    /** @var string */
11
    private $nodeName;
12
13
    /** @var string */
14
    private $additionalInformation;
15
16
    /** @var bool */
17
    private $erroDetect = false;
18
19
    public function __construct(int $line, string $nodeName)
20
    {
21
        $this->line = $line;
22
        $this->nodeName = $nodeName;
23
    }
24
25
    public function getLine(): int
26
    {
27
        return $this->line;
28
    }
29
30
    public function getNodeName(): string
31
    {
32
        return $this->nodeName;
33
    }
34
35
    public function foundError(string $addtionalInformation=''): void
36
    {
37
        $this->additionalInformation = $addtionalInformation;
38
        $this->erroDetect = true;
39
    }
40
41
    public function withError(): bool
42
    {
43
        return $this->erroDetect;
44
    }
45
46
    public function getAdditionalInformation(): string 
47
    {
48
        return $this->additionalInformation;
49
    }
50
}
51