Re: [RFC] [Discussion] Followup Improvements for ext/uri
| From: | Derick Rethans | Date: | Tue, 09 Dec 2025 12:06:26 +0000 |
| Subject: | Re: [RFC] [Discussion] Followup Improvements for ext/uri | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129573@lists.php.net to get a copy of this message | ||
On Mon, 1 Dec 2025, Máté Kocsis wrote:
> I'd like to introduce my latest RFC that I've been working on for a
> while now: https://wiki.php.net/rfc/uri_followup.
>
> It proposes 5 followup improvements for ext/uri in the following areas:
> - URI Building
Would it make sense to have an interface for the set*() methods? Besides
build(), they all seem to have the same API.
> - Query Parameter Manipulation
I see this adds NoDiscard:
#[\NoDiscard(message: "as Uri\Rfc3986\Uri::withQueryParams() does not modify the object
itself")]
But the original methods on the classes don't have these NoDiscards, and
it doesn't seem that this RFC is suggesting to add them. It should at
least be consistent.
> - Accessing Path Segments as an Array
Compare:
"especially considering the fact that Uri\Rfc3986\Uri internally stores
the path as a list of segments."
And:
Uri\Rfc3986\Uri::withPathSegments() … internally concatenate the input
segments separated by a / character, and then trigger
Uri\Rfc3986\Uri::withPath() …
Why does it need to do this concattenation, and then call withPath() for
Rfc3986\Uri then?
cheers,
Derick
--
https://derickrethans.nl | https://xdebug.org | https://dram.io
Author of Xdebug. Like it? Consider supporting me: https://xdebug.org/support
mastodon: @derickr@phpc.social @xdebug@phpc.social