Total Complexity | 6 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class Path extends AbstractPart |
||
16 | { |
||
17 | /** @var string|null The original path string. */ |
||
18 | private ?string $path = null; |
||
19 | |||
20 | public function __construct(?string $path = null) |
||
21 | { |
||
22 | $this->path = $path; |
||
23 | } |
||
24 | |||
25 | public function getPath(): string |
||
26 | { |
||
27 | $this->initialize(); |
||
28 | |||
29 | return implode('/', array_map(static function ($value) { |
||
30 | return str_replace(' ', '%20', $value); |
||
31 | }, $this->data)); |
||
32 | } |
||
33 | |||
34 | public function setPath(string $path): void |
||
35 | { |
||
36 | $this->initialized = false; |
||
37 | $this->path = $path; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return mixed[] |
||
42 | */ |
||
43 | public function getSegments(): array |
||
44 | { |
||
45 | $this->initialize(); |
||
46 | |||
47 | return $this->data; |
||
48 | } |
||
49 | |||
50 | public function __toString(): string |
||
53 | } |
||
54 | |||
55 | protected function doInitialize(): void |
||
56 | { |
||
58 | } |
||
59 | } |
||
60 |