1 | <?php |
||
14 | final class PathRecorder |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var string[] |
||
19 | */ |
||
20 | private $path = []; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $pathSegment; |
||
26 | |||
27 | /** |
||
28 | * @param string $pathSegment |
||
29 | */ |
||
30 | public function __construct($pathSegment = ':') |
||
35 | |||
36 | /** |
||
37 | * Move to the path of the specified name |
||
38 | * |
||
39 | * @param string $path |
||
40 | */ |
||
41 | public function moveTo($path) |
||
45 | |||
46 | /** |
||
47 | * Move to the path of parent |
||
48 | */ |
||
49 | public function moveParent() |
||
53 | |||
54 | /** |
||
55 | * Get the path of current |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | public function current() |
||
63 | |||
64 | public function __toString() |
||
68 | |||
69 | } |
||
70 |