Conversation
0667c3e to
c074b2a
Compare
3ec979f to
893cc0e
Compare
TimWolla
left a comment
There was a problem hiding this comment.
First pass at comments. Didn't yet look at all files, but this looks like a good start. Will take another look after you reviewed my comments to avoid looking at all files twice in case they change.
Co-authored-by: Jordi Kroon <jkroon@onyourmarks.agency>
| <refsect1 role="seealso"> | ||
| &reftitle.seealso; | ||
| <simplelist> | ||
| <member><methodname>Uri\WhatWg\Url::getPassword</methodname></member> |
There was a problem hiding this comment.
Here it might make sense to also link to Uri\WhatWg\Url::withUsername (second position).
| <member><methodname>Uri\WhatWg\Url::getPassword</methodname></member> | |
| <member><methodname>Uri\WhatWg\Url::getPassword</methodname></member> | |
| <member><methodname>Uri\WhatWg\Url::withUsername</methodname></member> |
There was a problem hiding this comment.
I think doing so would make more sense for Uri because password is just a pseudo component together with username. For WHATWG URL, they are completely separate components with not much more connection than e.g. the host and port. I'm not against adding it though, so if you have a strong opinion, then I'm fine with it.
| <member><methodname>Uri\Rfc3986\Uri::toRawString</methodname></member> | ||
| <member><methodname>Uri\Rfc3986\Uri::toString</methodname></member> |
There was a problem hiding this comment.
| <member><methodname>Uri\Rfc3986\Uri::toRawString</methodname></member> | |
| <member><methodname>Uri\Rfc3986\Uri::toString</methodname></member> | |
| <member><methodname>Uri\Rfc3986\Uri::toString</methodname></member> |
I think having just one here is sufficient to point users into the right direction.
There was a problem hiding this comment.
I wouldn't pick just one of the toString methods, and in the same way, I wouldn't pick only one of the getters. I think including both variants wouldn't hurt, and if someone actually wants to look up the omitted variant then the extra link saves them an extra navigation step.
All in all, IMO it's not a huge deal either way, but I pretty much like the completeness here.
| <member><methodname>Uri\Rfc3986\Uri::toRawString</methodname></member> | ||
| <member><methodname>Uri\Rfc3986\Uri::toString</methodname></member> |
There was a problem hiding this comment.
| <member><methodname>Uri\Rfc3986\Uri::toRawString</methodname></member> | |
| <member><methodname>Uri\Rfc3986\Uri::toString</methodname></member> | |
| <member><methodname>Uri\Rfc3986\Uri::toString</methodname></member> |
Also applies to the other getters (if they list both the raw and normalized versions).
| <?php | ||
| $url = \Uri\WhatWg\Url::parse("https://example.com"); | ||
|
|
||
| if ($url === null) { | ||
| echo "Invalid URL" | ||
| } else { | ||
| echo "Valid URL " . $uri->toAsciiString(); | ||
| } | ||
| ?> |
There was a problem hiding this comment.
| <?php | |
| $url = \Uri\WhatWg\Url::parse("https://example.com"); | |
| if ($url === null) { | |
| echo "Invalid URL" | |
| } else { | |
| echo "Valid URL " . $uri->toAsciiString(); | |
| } | |
| ?> | |
| <?php | |
| $url = \Uri\WhatWg\Url::parse("https://example.com"); | |
| if ($url !== null) { | |
| echo "Valid URL ", $url->toAsciiString(); | |
| } else { | |
| echo "Invalid URL"; | |
| } | |
| ?> |
There was a problem hiding this comment.
Sorry, I don't like the echo "...", "" construct, so I left this one out from the changes. I think regular concatenation is more widely known
| &reftitle.parameters; | ||
| <variablelist> | ||
| <varlistentry> | ||
| <term><parameter>uri</parameter></term> |
There was a problem hiding this comment.
Is it actually called uri in the stubs? 🙈
There was a problem hiding this comment.
Yes, because uri tries to suggest that relative references are also possible (which are called by WHATWG URL as "relative URL strings"). This was my best idea back then.
Another attempt to document ext/uri after #5060
Some of my sentences are very clunky, so I am happy to receive suggestions.