Uri Fix classname and extra e.g., amend examples, describe normalization - #5548
Open
mmalferov wants to merge 42 commits into
Open
Uri Fix classname and extra e.g., amend examples, describe normalization#5548mmalferov wants to merge 42 commits into
Uri Fix classname and extra e.g., amend examples, describe normalization#5548mmalferov wants to merge 42 commits into
Conversation
e.g.Uri\WhatWg\Url::construct Fix classname and extra e.g.
Uri\WhatWg\Url::construct Fix classname and extra e.g.Uri\WhatWg\Url::construct Fix classname and extra e.g., amend example
Uri\WhatWg\Url::construct Fix classname and extra e.g., amend exampleUri\WhatWg\Url::construct Fix classname and extra e.g., amend examples
lacatoire
approved these changes
May 12, 2026
Uri\WhatWg\Url::construct Fix classname and extra e.g., amend examplesUri Fix classname and extra e.g., amend examples
Uri Fix classname and extra e.g., amend examplesUri Fix classname and extra e.g., amend examples, describe normalization
Member
|
FYI: This will conflict with #5471. |
And is the return type `?static` accurate and not `?self` or literally `?Uri\WhatWg\Url`, and doesn't it confuse the reader, since the class is final?
```PHP_METHOD(Uri_Rfc3986_Uri, getPort)
{
php_uri_property_read_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_URI_PROPERTY_NAME_PORT, PHP_URI_COMPONENT_READ_MODE_RAW);
}```
Judging by the source code, the `port` component, unlike the `password` or the `host` components, is not normalized. It seems that the mention of normalization was included in the description by mistake :)
```PHP_METHOD(Uri_Rfc3986_Uri, getPassword)
{
php_uri_property_read_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_URI_PROPERTY_NAME_PASSWORD, PHP_URI_COMPONENT_READ_MODE_NORMALIZED_ASCII);
}```
...an non-normalized in the return section for consistency with other methods
The example rewrites in the RFC 3986 getter pages overlap with php#5471, which unifies the example URL across all of them; reverting them here leaves the two pull requests disjoint. The normalization entities and the wording changes stay. Also corrects four points in what is left: - the normalization entity omitted dot segment removal, which is what getPath() visibly does - the non-normalization entity claimed components are returned in their original form, which toRawString() and a resolved getRawPath() both contradict - getPort() does normalize, it drops leading zeros, so the page keeps its wording - Ipv4InIpv6InvalidCodePoint is also raised for an empty part, a leading zero and too many parts, not only for an invalid code point
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.
No description provided.