1 | <?php |
||
22 | class Fragment extends AbstractPart |
||
23 | { |
||
24 | /** |
||
25 | * @var string The original fragment string. |
||
26 | */ |
||
27 | private $fragment; |
||
28 | |||
29 | /** |
||
30 | * Construct a new Fragment instance. |
||
31 | * |
||
32 | * @param string|Path|null $fragment Path instance of string fragment. |
||
33 | * @param Query|null $query |
||
34 | */ |
||
35 | 65 | public function __construct($fragment = null, Query $query = null) |
|
56 | |||
57 | /** @noinspection PhpMissingParentCallCommonInspection */ |
||
58 | /** |
||
59 | * @inheritDoc |
||
60 | * @override |
||
61 | */ |
||
62 | 1 | public function set($key, $value) |
|
69 | |||
70 | /** |
||
71 | * Builds a string fragment from this Fragment instance internal data and returns it. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 24 | public function getFragment(): string |
|
85 | |||
86 | /** |
||
87 | * Set the string fragment for this Fragment instance and sets initialized to false. |
||
88 | * |
||
89 | * @param $fragment |
||
90 | * |
||
91 | * @return $this |
||
92 | */ |
||
93 | 1 | public function setFragment($fragment) |
|
101 | |||
102 | /** |
||
103 | * Set the Path instance. |
||
104 | * |
||
105 | * @param Path $path |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | 1 | public function setPath(Path $path) |
|
115 | |||
116 | /** |
||
117 | * Get the Path instance. |
||
118 | * |
||
119 | * @return Path |
||
120 | */ |
||
121 | 1 | public function getPath(): Path |
|
127 | |||
128 | /** |
||
129 | * Set the Query instance. |
||
130 | * |
||
131 | * @param Query $query |
||
132 | * |
||
133 | * @return $this |
||
134 | */ |
||
135 | 1 | public function setQuery(Query $query) |
|
141 | |||
142 | /** |
||
143 | * Get the Query instance. |
||
144 | * |
||
145 | * @return Query |
||
146 | */ |
||
147 | 1 | public function getQuery(): Query |
|
153 | |||
154 | /** |
||
155 | * @inheritDoc |
||
156 | */ |
||
157 | 22 | public function __toString() |
|
161 | |||
162 | /** |
||
163 | * @inheritDoc |
||
164 | */ |
||
165 | 22 | protected function doInitialize() |
|
175 | } |
||
176 |