Skip to content

Uri Fix classname and extra e.g., amend examples, describe normalization - #5548

Open
mmalferov wants to merge 42 commits into
php:masterfrom
mmalferov:patch-62
Open

Uri Fix classname and extra e.g., amend examples, describe normalization#5548
mmalferov wants to merge 42 commits into
php:masterfrom
mmalferov:patch-62

Conversation

@mmalferov

Copy link
Copy Markdown
Member

No description provided.

@mmalferov
mmalferov requested a review from TimWolla as a code owner May 8, 2026 23:45
@mmalferov mmalferov changed the title construct.xml Fix classname and extra e.g. Uri\WhatWg\Url::construct Fix classname and extra e.g. May 8, 2026
@mmalferov mmalferov changed the title Uri\WhatWg\Url::construct Fix classname and extra e.g. Uri\WhatWg\Url::construct Fix classname and extra e.g., amend example May 9, 2026
@mmalferov mmalferov changed the title Uri\WhatWg\Url::construct Fix classname and extra e.g., amend example Uri\WhatWg\Url::construct Fix classname and extra e.g., amend examples May 9, 2026
@mmalferov mmalferov changed the title Uri\WhatWg\Url::construct Fix classname and extra e.g., amend examples Uri Fix classname and extra e.g., amend examples May 17, 2026
@mmalferov mmalferov changed the title Uri Fix classname and extra e.g., amend examples Uri Fix classname and extra e.g., amend examples, describe normalization May 17, 2026
@jordikroon
jordikroon requested a review from kocsismate May 17, 2026 20:16
@TimWolla

Copy link
Copy Markdown
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);
}```
mmalferov and others added 21 commits September 9, 2026 10:43
...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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants