Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
48 | 82 | public function getPath(): string |
|
49 | { |
||
50 | 82 | $result = ['$']; |
|
51 | |||
52 | 82 | for ($index = 1; $index <= $this->pathIndex; $index++) { |
|
53 | 62 | if (!empty($this->pathNames[$index])) { |
|
54 | 26 | $result[] .= '.'.$this->pathNames[$index]; |
|
55 | 26 | continue; |
|
56 | } |
||
57 | |||
58 | // skip initial value |
||
59 | 48 | if ($this->pathIndices[$index] === -1) { |
|
60 | 30 | continue; |
|
61 | } |
||
62 | |||
63 | 22 | $result[] .= '['.$this->pathIndices[$index].']'; |
|
64 | } |
||
65 | |||
66 | 82 | return implode($result); |
|
67 | } |
||
69 |