| @@ 241-251 (lines=11) @@ | ||
| 238 | /** |
|
| 239 | * {@inheritdoc} |
|
| 240 | */ |
|
| 241 | public function withQuery($query) |
|
| 242 | { |
|
| 243 | if (!is_string($query) && !method_exists($query, '__toString')) { |
|
| 244 | throw new InvalidArgumentException('Uri query must be a string'); |
|
| 245 | } |
|
| 246 | $query = ltrim((string)$query, '?'); |
|
| 247 | $clone = clone $this; |
|
| 248 | $clone->query = $this->filterQuery($query); |
|
| 249 | ||
| 250 | return $clone; |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * {@inheritdoc} |
|
| @@ 256-266 (lines=11) @@ | ||
| 253 | /** |
|
| 254 | * {@inheritdoc} |
|
| 255 | */ |
|
| 256 | public function withFragment($fragment) |
|
| 257 | { |
|
| 258 | if (!is_string($fragment) && !method_exists($fragment, '__toString')) { |
|
| 259 | throw new InvalidArgumentException('Uri fragment must be a string'); |
|
| 260 | } |
|
| 261 | $fragment = ltrim((string)$fragment, '#'); |
|
| 262 | $clone = clone $this; |
|
| 263 | $clone->fragment = $this->filterQuery($fragment); |
|
| 264 | ||
| 265 | return $clone; |
|
| 266 | } |
|
| 267 | ||
| 268 | /** |
|
| 269 | * {@inheritdoc} |
|