Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6cffe8c
construct.xml Fix classname and extra `e.g.`
mmalferov May 8, 2026
1307081
getasciihost.xml Add more relevant non-ASCII URL for example
mmalferov May 9, 2026
9c89360
parse.xml Remove extra `e.g` and add missing `;` in the example
mmalferov May 9, 2026
151cf5b
toasciistring.xml Give an URL relevant for the example
mmalferov May 12, 2026
da424b2
tounicodestring.xml Show how method works
mmalferov May 14, 2026
f6dc538
unserialize.xml Let's deserialize the array, not the parameter
mmalferov May 14, 2026
7733e37
getfragment.xml Show how the method works
mmalferov May 17, 2026
a9c0dab
getfragment.xml Clarify fragment normalization
mmalferov May 17, 2026
0ff3052
language-snippets.ent Add the URI normalization snippet
mmalferov May 17, 2026
974bd18
getfragment.xml Replace a literal sentence with a variable
mmalferov May 17, 2026
b5542a6
gethost.xml Clarify normalization
mmalferov May 17, 2026
20a132b
getfragment.xml Move the normalization description to a `simpara`
mmalferov May 17, 2026
0a937a5
gethost.xml Move the normalization description to a `simpara`
mmalferov May 17, 2026
8d0dc93
gethost.xml Show an example of normalization
mmalferov May 17, 2026
22c1ae3
getpassword.xml Add normalization description
mmalferov May 17, 2026
080bdb4
getpath.xml Mention normalization mechanism
mmalferov May 17, 2026
7763206
getpath.xml Show how the method works
mmalferov May 17, 2026
0f20265
getport.xml Remove the mention of normalization
mmalferov May 17, 2026
857d3f5
getquery.xml Add the normalization description + show how the method …
mmalferov May 17, 2026
471a19e
language-snippets.ent Add the non-normalization snippet
mmalferov May 17, 2026
73d83b3
getrawfragment.xml Add the non-normalization desc
mmalferov May 17, 2026
3157925
getrawfragment.xml Show how the method works
mmalferov May 17, 2026
0d59652
getrawhost.xml Describe non-normalization + show how the method works
mmalferov May 17, 2026
e084ce4
Update getrawhost.xml
mmalferov May 17, 2026
c1bf554
getrawpassword.xml Describe non-normalization + show how the method w…
mmalferov May 17, 2026
bc0b4a6
getrawpath.xml Describe non-normalization + show how the method works
mmalferov May 17, 2026
0cd7197
getrawquery.xml Describe non-serialization + show how the method works
mmalferov May 17, 2026
1d4be5d
getrawscheme.xml Describe non-normalization + show how the method works
mmalferov May 17, 2026
8d94c78
getrawuserinfo.xml Describe non-normalization + amend the example
mmalferov May 17, 2026
269582f
getrawpassword.xml Remove the mention of...
mmalferov May 17, 2026
dd61825
getrawusername.xml Describe non-normalization
mmalferov May 17, 2026
a010680
getscheme.xml Describe normalization + show how the method works
mmalferov May 17, 2026
79b1bfb
getuserinfo.xml Describe normalization + show how the method works
mmalferov May 17, 2026
bf78715
getusername.xml Describe normalization + show how the method works
mmalferov May 17, 2026
ff5c213
Update language-snippets.ent
mmalferov May 17, 2026
0730d39
Update parse.xml Add missed `;`
mmalferov May 17, 2026
7c88453
resolve.xml The method works not only with URLs
mmalferov May 17, 2026
5e2b7e5
torawstring.xml Describe non-normalization + show how the method works
mmalferov May 17, 2026
30b8be2
tostring.xml Describe normalization + show how to method works
mmalferov May 17, 2026
54f4dc8
Update withfragment.xml Add `<?php` tag
mmalferov May 17, 2026
e8e358c
uri.whatwg.urlvalidationerrortype.xml Add missing desc
mmalferov May 17, 2026
af43763
Keep the shared getter examples out of this pull request
lacatoire Sep 9, 2026
5d88f3d
Correct the normalization wording and the relative URL examples
lacatoire Sep 9, 2026
7ea35bb
Use the manual's usual IDN label in the Url examples
lacatoire Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions language-snippets.ent
Original file line number Diff line number Diff line change
Expand Up @@ -4436,6 +4436,18 @@ local: {
</simpara>
'>

<!ENTITY uri.normalization '
<simpara>
Hexadecimal triplets are converted to uppercase, percent-encoded unreserved characters are decoded, the scheme and host components are normalized to lowercase, and dot segments are removed from the path, per RFC 3986.
</simpara>
'>

<!ENTITY uri.non-normalization '
<simpara>
Hexadecimal triplets are not converted to uppercase, percent-encoded unreserved characters remain encoded, the scheme and host components keep the case they were given in, and dot segments are kept in the path.
</simpara>
'>

<!-- UOPZ snippets -->

<!ENTITY uopz.warn.removed.function-5-0-0 '<warning
Expand Down
2 changes: 1 addition & 1 deletion reference/uri/uri.whatwg.urlvalidationerrortype.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

<enumitem>
<enumidentifier>Ipv4InIpv6InvalidCodePoint</enumidentifier>
<enumitemdescription>An IPv6 address with IPv4 address syntax.</enumitemdescription>
<enumitemdescription>An IPv6 address with IPv4 address syntax: an IPv4 part is empty, contains a non-ASCII digit or a leading zero, or there are too many IPv4 parts.</enumitemdescription>
</enumitem>

<enumitem>
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getfragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the normalized fragment component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/gethost.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the normalized host component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getpassword.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Retrieves the normalized password part (the text after the first <literal>:</literal> character)
from the userinfo component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getpath.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the normalized path component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getquery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the normalized query component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getrawfragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the raw (non-normalized) fragment component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getrawhost.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the raw (non-normalized) host component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
3 changes: 2 additions & 1 deletion reference/uri/uri/rfc3986/uri/getrawpassword.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Retrieves the raw (non-normalized) password part (the text after the first <literal>:</literal> character)
from the userinfo component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand All @@ -25,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns the raw (non-normalized) password as a &string; if the userinfo component contains a <literal>:</literal> character.
Returns the raw password as a &string; if the userinfo component contains a <literal>:</literal> character.
An empty string is returned when the userinfo component doesn't contain a <literal>:</literal> character.
&null; is returned when the userinfo component doesn't exist.
</simpara>
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getrawpath.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the raw (non-normalized) path component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getrawquery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the raw (non-normalized) query component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getrawscheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the raw (non-normalized) scheme component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getrawuserinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the raw (non-normalized) userinfo component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
3 changes: 2 additions & 1 deletion reference/uri/uri/rfc3986/uri/getrawusername.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Retrieves the raw (non-normalized) username part (the text before the first <literal>:</literal> character)
from userinfo component.
</simpara>
&uri.non-normalization;
</refsect1>

<refsect1 role="parameters">
Expand All @@ -25,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns the raw (non-normalized) username as a &string; if the userinfo component exists, &null; is returned otherwise.
Returns the raw username as a &string; if the userinfo component exists, &null; is returned otherwise.
</simpara>
</refsect1>

Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getscheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the normalized scheme component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getuserinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Retrieves the normalized userinfo component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/getusername.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Retrieves the normalized username part (the text before the first <literal>:</literal> character)
from the userinfo component.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
2 changes: 1 addition & 1 deletion reference/uri/uri/rfc3986/uri/parse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
<programlisting role="php">
<![CDATA[
<?php

$uri = \Uri\Rfc3986\Uri::parse("https://example.com");

if ($uri !== null) {
echo "Valid URI: " . $uri->toString();
} else {
echo "Invalid URI";
}
?>
]]>
</programlisting>
&example.outputs;
Expand Down
6 changes: 3 additions & 3 deletions reference/uri/uri/rfc3986/uri/resolve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<refentry xml:id="uri-rfc3986-uri.resolve" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Uri\Rfc3986\Uri::resolve</refname>
<refpurpose>Resolve a URI with the current object as the base URL</refpurpose>
<refpurpose>Resolve a URI with the current object as the base URI</refpurpose>
</refnamediv>

<refsect1 role="description">
Expand All @@ -12,7 +12,7 @@
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
</methodsynopsis>
<simpara>
Resolves a URI - which may potentially be a relative reference - with the current object as the base URL.
Resolves a URI - which may potentially be a relative reference - with the current object as the base URI.
</simpara>
</refsect1>

Expand Down Expand Up @@ -49,11 +49,11 @@
<programlisting role="php">
<![CDATA[
<?php

$uri = new \Uri\Rfc3986\Uri("https://example.com");
$uri = $uri->resolve("/foo");

echo $uri->toRawString();
?>
]]>
</programlisting>
&example.outputs;
Expand Down
8 changes: 7 additions & 1 deletion reference/uri/uri/rfc3986/uri/torawstring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
<simpara>
Recomposes the raw (non-normalized) URI to a &string;.
</simpara>
&uri.non-normalization;
<simpara>
An IPv6 host is an exception: it is recomposed from its parsed form, and is
therefore returned fully expanded and in lowercase, whatever notation the
input used.
</simpara>
</refsect1>

<refsect1 role="parameters">
Expand All @@ -24,7 +30,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns the recomposed raw (non-normalized) URI as a &string;.
Returns the recomposed raw URI as a &string;.
</simpara>
</refsect1>

Expand Down
1 change: 1 addition & 0 deletions reference/uri/uri/rfc3986/uri/tostring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<simpara>
Recomposes the normalized URI to a &string;.
</simpara>
&uri.normalization;
</refsect1>

<refsect1 role="parameters">
Expand Down
2 changes: 1 addition & 1 deletion reference/uri/uri/rfc3986/uri/withfragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
<programlisting role="php">
<![CDATA[
<?php

$uri = new \Uri\Rfc3986\Uri("https://example.com/#foo");
$uri = $uri->withFragment("bar");

echo $uri->getFragment();
?>
]]>
</programlisting>
&example.outputs;
Expand Down
7 changes: 5 additions & 2 deletions reference/uri/uri/whatwg/url/construct.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<methodparam choice="opt"><type>array</type><parameter role="reference">softErrors</parameter><initializer>&null;</initializer></methodparam>
</constructorsynopsis>
<simpara>
Constructs the <classname>Uri\Rfc3986\Uri</classname> object.
Constructs the <classname>Uri\WhatWg\Url</classname> object.
</simpara>
</refsect1>

Expand All @@ -25,7 +25,10 @@
<term><parameter>uri</parameter></term>
<listitem>
<simpara>
A valid URL string to parse (e.g. <literal>/foo</literal> or (e.g. <literal>https://example.com/foo</literal>).
A URL string to parse, for instance
<literal>https://example.com/foo</literal>. A relative-URL string such as
<literal>/foo</literal> is only accepted when
<parameter>baseUrl</parameter> is given.
</simpara>
</listitem>
</varlistentry>
Expand Down
6 changes: 3 additions & 3 deletions reference/uri/uri/whatwg/url/getasciihost.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
<programlisting role="php">
<![CDATA[
<?php
$url = new \Uri\WhatWg\Url("https://example.com");

$url = new \Uri\WhatWg\Url("https://täst.example.com");

echo $url->getAsciiHost();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
example.com
xn--tst-qla.example.com
]]>
</screen>
</example>
Expand Down
7 changes: 5 additions & 2 deletions reference/uri/uri/whatwg/url/parse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
<term><parameter>uri</parameter></term>
<listitem>
<simpara>
A valid URL string to parse (e.g. <literal>/foo</literal> or (e.g. <literal>https://example.com/foo</literal>).
A URL string to parse, for instance
<literal>https://example.com/foo</literal>. A relative-URL string such as
<literal>/foo</literal> is only accepted when
<parameter>baseUrl</parameter> is given.
</simpara>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -66,14 +69,14 @@
<programlisting role="php">
<![CDATA[
<?php

$url = \Uri\WhatWg\Url::parse("https://example.com");

if ($url !== null) {
echo "Valid URL: " . $url->toAsciiString();
} else {
echo "Invalid URL";
}
?>
]]>
</programlisting>
&example.outputs;
Expand Down
2 changes: 1 addition & 1 deletion reference/uri/uri/whatwg/url/resolve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<term><parameter>uri</parameter></term>
<listitem>
<simpara>
A valid URL string (e.g. <literal>/foo</literal> or (e.g. <literal>https://example.com/foo</literal>) to apply on
A valid URL string (e.g. <literal>/foo</literal> or <literal>https://example.com/foo</literal>) to apply on
the current object.
</simpara>
</listitem>
Expand Down
6 changes: 3 additions & 3 deletions reference/uri/uri/whatwg/url/toasciistring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
<programlisting role="php">
<![CDATA[
<?php
$url = new \Uri\WhatWg\Url("https://example.com/foo/bar?baz");

$url = new \Uri\WhatWg\Url("https://täst.example.com/foo/bar?baz");

echo $url->toAsciiString();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
https://example.com/foo/bar?baz
https://xn--tst-qla.example.com/foo/bar?baz
]]>
</screen>
</example>
Expand Down
6 changes: 3 additions & 3 deletions reference/uri/uri/whatwg/url/tounicodestring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
<programlisting role="php">
<![CDATA[
<?php
$url = new \Uri\WhatWg\Url("https://example.com/foo/bar?baz");

$url = new \Uri\WhatWg\Url("https://xn--tst-qla.example.com/foo/bar?baz");

echo $url->toUnicodeString();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
https://example.com/foo/bar?baz
https://täst.example.com/foo/bar?baz
]]>
</screen>
</example>
Expand Down
4 changes: 2 additions & 2 deletions reference/uri/uri/whatwg/url/unserialize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<refentry xml:id="uri-whatwg-url.unserialize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Uri\WhatWg\Url::__unserialize</refname>
<refpurpose>Deserialize the data parameter into a Url object</refpurpose>
<refpurpose>Deserialize the array from the data parameter into a Url object</refpurpose>
</refnamediv>

<refsect1 role="description">
Expand All @@ -12,7 +12,7 @@
<methodparam><type>array</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<simpara>
Deserializes a data parameter into a <classname>Uri\WhatWg\Url</classname> object.
Deserializes the &array; from the <parameter>data</parameter> parameter into a <classname>Uri\WhatWg\Url</classname> object.
</simpara>
</refsect1>

Expand Down