From 91fde08f52116c7bf6419bc36bf9d3c7490d3d1f Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 19 Dec 2020 20:31:34 +0100 Subject: [PATCH] add multiple fragment support --- Uri/HttpUri.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Uri/HttpUri.php b/Uri/HttpUri.php index c40bedd56..5e7c2e0b7 100644 --- a/Uri/HttpUri.php +++ b/Uri/HttpUri.php @@ -134,6 +134,14 @@ final class HttpUri implements UriInterface */ public string $fragment; + /** + * Uri fragments. + * + * @var array + * @since 1.0.0 + */ + public array $fragments = []; + /** * Uri base. * @@ -204,8 +212,9 @@ final class HttpUri implements UriInterface $this->query = \array_change_key_case($this->query, \CASE_LOWER); - $this->fragment = $url['fragment'] ?? ''; - $this->base = $this->scheme . '://' . $this->host . ($this->port !== 80 ? ':' . $this->port : '') . $this->rootPath; + $this->fragment = $url['fragment'] ?? ''; + $this->fragments = \explode(',', $url['fragment'] ?? ''); + $this->base = $this->scheme . '://' . $this->host . ($this->port !== 80 ? ':' . $this->port : '') . $this->rootPath; } /**