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