neos / flow-development-collection

The unified repository containing the Flow core packages, used for Flow development.
https://flow.neos.io/
MIT License
134 stars 187 forks source link

!!! TASK: Refactor uri helpers #3336

Closed mhsdesign closed 3 months ago

mhsdesign commented 3 months ago

See #3316

Upgrade instructions

The following methods were removed from the UriHelper as they are obsolete and not used. Its unlikely that the functionality is known and simple to implement yourself.

The method \Neos\Flow\Http\Helper\UriHelper::uriWithArguments was renamed to \Neos\Flow\Http\Helper\UriHelper::uriWithQueryParameters to distinct between route values and query parameters which are not the same. Also it will encode the query parameters after PHP_QUERY_RFC1738.

Review instructions

The pr #3316 introduced a new uri helper while we already had one actually. This pr combines the two and cleans things up.

To ensure the logic of uriWithAdditionalQueryParameters is not duplicated and possibly handled elsewhere differently the helper is now also used internally by the uriConstraints.

Also the method has been renamed to better fit the previous sibling uriWithArguments.

The removed methods are dead code and previously introduced once with Flow 5.1: https://github.com/neos/flow-development-collection/commit/85408589462b7530180d3dce2858500f29f94bbe As part of replacements for the old (now removed) flow Uri implementation:

Neos\Flow\Http\Uri::getUsername -> \Neos\Flow\Http\Helper\UriHelper::getUsername Neos\Flow\Http\Uri::getPassword -> \Neos\Flow\Http\Helper\UriHelper::getPassword Neos\Flow\Http\Uri::getArguments -> \Neos\Flow\Http\Helper\UriHelper::parseQueryIntoArguments

So maybe these methods are known in fact and it would be a bit mean to remove them just because i felt like it and we dont use / test them?

Checklist

mhsdesign commented 3 months ago

I dont know if i was to eager deleting stuff so i summon @kitsunet to please have a look at it and veto if plausible :D