Repository navigation
refactor(http): build FlexiBee URLs natively instead of ecomailcz/purl - #51
Merged
Merged
Conversation
pekral
marked this pull request as draft
November 12, 2026 14:08
pekral
marked this pull request as ready for review
November 12, 2026 14:15
Collaborator
Author
CR status — convergedStatus: converged after 2 review iterations · Critical 0 · Moderate 0 Resolved items
|
Collaborator
Author
Code ReviewStatus: clean Summary: 0 Critical · 0 Moderate · 0 Minor · 0 Refactoring · assignment conformance: conformant (#49: purl removed, URLs unchanged for the tested inputs, base URL without scheme or host rejected, UrlBuilder no longer extends Purl\Url) · reviewer comments: none |
UrlBuilder no longer extends Purl\Url. It keeps scheme, user info, host and port of the configured URL and appends the path (spaces encoded as %20) and the http_build_query() query, exactly as purl did: the output of every builder method is byte-identical for the tested inputs. A base URL without scheme or host is now rejected when the client is created instead of silently producing a relative URL. BREAKING CHANGE: UrlBuilder no longer inherits the public Purl\Url API, and its constructor no longer accepts a Purl\ParserInterface. Closes #49
CR finding (Minor): createRestoreUrl() interpolated the company name into the query string unencoded, so a name containing "&" or "#" added query parameters or truncated the URL. The name is now rawurlencode()d; names with spaces only produce the same URL as before.
CR finding (Minor): the exception for a base URL without scheme or host echoed the URL, which can carry "user:password@" and would leak it into logs. The message now names the problem without the value.
pekral
force-pushed
the
feat/replace-purl
branch
from
November 12, 2026 14:27
b564198 to
ef407c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #49
TL;DR
Odstraňuje závislost
ecomailcz/purl.UrlBuilderskládá URL nativními funkcemi PHP (parse_url(),http_build_query()). Všechny vygenerované URL zůstávají stejné.Změny
UrlBuilderuž nedědí zPurl\Url. Ze základní URL si bere schéma, přihlašovací údaje, hostitele a port. Přidá cestu, ve které jsou mezery jako%20(jako dřív), a query přeshttp_build_query()s výchozímlimit=0.demo.flexibee.eu) se odmítne výjimkouEcomailFlexibeeRequestFailuž při vytvoření klienta. Dřív se tiše vytvořila relativní URL a požadavek selhal až v cURL.createRestoreUrl()se nově kóduje (rawurlencode()). Dřív by název s&nebo#přidal do URL parametr nebo ji uřízl. Názvy jen s mezerami dávají stejnou URL jako dřív.user:heslo@).ecomailcz/purlje odebraný zcomposer.json. Deprecations na PHP 8.4+ teď hlásí už jenrakit/validation(komentář vphpunit.xmlupravený).Merge danger
UrlBuilderuž nemá zděděné veřejné metodyPurl\Url(setPath(),getUrl(),setQuery()…);Purl\ParserInterface.UrlBuilderpoužívá interně jenClient, běžné použití klienta se nemění.Testování
UrlBuilder: 96 URL ze 4 základních adres (s portem, s lomítkem na konci, s přihlašovacími údaji a cestou, bez portu) a s filtry obsahujícími mezery, závorky, uvozovky,&,#,?, diakritiku apod. Výstupy jsou bajtově shodné (kromě názvu firmy u restore se znaky&/#, viz opravu výše).tests/Http/QueryBuilderTest.php: všechny metody, zachování portu a přihlašovacích údajů, odmítnutí URL bez schématu.composer checkprochází, pokrytí změněných řádků je 30/30.