| 1 | <?php |
||
| 19 | class Path extends AbstractPart |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string The original path string. |
||
| 23 | */ |
||
| 24 | private $path; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Construct a new Path instance. |
||
| 28 | * |
||
| 29 | * @param string $path |
||
| 30 | */ |
||
| 31 | 69 | public function __construct($path = null) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Builds a string path from this Path instance internal data and returns it. |
||
| 38 | * |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 29 | public function getPath(): string |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Set the string path for this Path instance and sets initialized to false. |
||
| 57 | * |
||
| 58 | * @param string |
||
| 59 | */ |
||
| 60 | 2 | public function setPath($path) |
|
| 65 | |||
| 66 | /** |
||
| 67 | * Get the array of segments that make up the path. |
||
| 68 | * |
||
| 69 | * @return array |
||
| 70 | */ |
||
| 71 | 1 | public function getSegments(): array |
|
| 77 | |||
| 78 | /** |
||
| 79 | * @inheritDoc |
||
| 80 | */ |
||
| 81 | 27 | public function __toString() |
|
| 85 | |||
| 86 | /** |
||
| 87 | * @inheritDoc |
||
| 88 | */ |
||
| 89 | 30 | protected function doInitialize() |
|
| 93 | } |
||
| 94 |