Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
44.44% |
4 / 9 |
|
28.57% |
2 / 7 |
CRAP | |
0.00% |
0 / 1 |
DiscoveredSymbol | |
44.44% |
4 / 9 |
|
28.57% |
2 / 7 |
15.40 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
getOriginalSymbol | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setSymbol | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getFile | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setFile | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getReplacement | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setReplacement | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * A namespace, class, interface or trait discovered in the project. |
4 | */ |
5 | |
6 | namespace BrianHenryIE\Strauss; |
7 | |
8 | abstract class DiscoveredSymbol |
9 | { |
10 | protected ?File $file; |
11 | |
12 | protected string $symbol; |
13 | |
14 | protected string $replacement; |
15 | |
16 | /** |
17 | * @param string $symbol The classname / namespace etc. |
18 | * @param File $file The file it was discovered in. |
19 | */ |
20 | public function __construct(string $symbol, File $file) |
21 | { |
22 | $this->symbol = $symbol; |
23 | $this->file = $file; |
24 | |
25 | $file->addDiscoveredSymbol($this); |
26 | } |
27 | |
28 | public function getOriginalSymbol(): string |
29 | { |
30 | return $this->symbol; |
31 | } |
32 | |
33 | public function setSymbol(string $symbol): void |
34 | { |
35 | $this->symbol = $symbol; |
36 | } |
37 | |
38 | public function getFile(): ?File |
39 | { |
40 | return $this->file; |
41 | } |
42 | |
43 | public function setFile(File $file): void |
44 | { |
45 | $this->file = $file; |
46 | } |
47 | |
48 | public function getReplacement(): string |
49 | { |
50 | return $this->replacement ?? $this->symbol; |
51 | } |
52 | |
53 | public function setReplacement(string $replacement): void |
54 | { |
55 | $this->replacement = $replacement; |
56 | } |
57 | } |