add multiple fragment support

This commit is contained in:
Dennis Eichhorn 2020-12-19 20:31:34 +01:00
parent 7981adf359
commit 91fde08f52

View File

@ -134,6 +134,14 @@ final class HttpUri implements UriInterface
*/ */
public string $fragment; public string $fragment;
/**
* Uri fragments.
*
* @var array
* @since 1.0.0
*/
public array $fragments = [];
/** /**
* Uri base. * Uri base.
* *
@ -204,8 +212,9 @@ final class HttpUri implements UriInterface
$this->query = \array_change_key_case($this->query, \CASE_LOWER); $this->query = \array_change_key_case($this->query, \CASE_LOWER);
$this->fragment = $url['fragment'] ?? ''; $this->fragment = $url['fragment'] ?? '';
$this->base = $this->scheme . '://' . $this->host . ($this->port !== 80 ? ':' . $this->port : '') . $this->rootPath; $this->fragments = \explode(',', $url['fragment'] ?? '');
$this->base = $this->scheme . '://' . $this->host . ($this->port !== 80 ? ':' . $this->port : '') . $this->rootPath;
} }
/** /**