@@ 226-236 (lines=11) @@ | ||
223 | /** |
|
224 | * {@inheritdoc} |
|
225 | */ |
|
226 | public function withQuery($query) |
|
227 | { |
|
228 | if (!is_string($query)) { |
|
229 | throw new \InvalidArgumentException("Invalid query: {$query}"); |
|
230 | } |
|
231 | ||
232 | $instance = clone $this; |
|
233 | $instance->query = ltrim($query, '?'); |
|
234 | ||
235 | return $instance; |
|
236 | } |
|
237 | ||
238 | /** |
|
239 | * {@inheritdoc} |
|
@@ 241-251 (lines=11) @@ | ||
238 | /** |
|
239 | * {@inheritdoc} |
|
240 | */ |
|
241 | public function withFragment($fragment) |
|
242 | { |
|
243 | if (!is_string($fragment)) { |
|
244 | throw new \InvalidArgumentException("Invalid fragment: {$fragment}"); |
|
245 | } |
|
246 | ||
247 | $instance = clone $this; |
|
248 | $instance->fragment = ltrim($fragment, '#'); |
|
249 | ||
250 | return $instance; |
|
251 | } |
|
252 | ||
253 | /** |
|
254 | * {@inheritdoc} |