-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
@webimpress I fixed the error with the last commit. I did all the work on a test machine, but couldn't commit from there, and I rewrote the modifications on web. During the process, I somehow forgot to remove the |
@mtagliab Thanks, I'll have a look on it shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mtagliab Thanks for your contribution, it looks good, just two small comments.
src/Uri.php
Outdated
$this->setPort((int) $port); | ||
// If authority ends with colon, port will be empty string. | ||
// Remove the colon from authority, but keeps port null | ||
if ($port && $port !== '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ($port)
is sufficient here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but I preferred keeping the strict compare. I'll change it right now
test/UriTest.php
Outdated
$uri = new Uri($uriString); | ||
|
||
$this->assertSame($uri->getHost(), 'www.example.com'); | ||
$this->assertSame($uri->getPort(), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please swap arguments - first is EXPECTED and the second is ACTUAL
@mtagliab Also, the target branch should be master, not develop. Could you rebase it and change the target, please? |
@webimpress I never rebased a repo. What should I do, exactly? |
|
@webimpress could it be merged now? |
@mtagliab I need to review first, will try to do it today |
https://www.php.net/manual/en/migration70.incompatible.php#119151 substr behavior has changed from PHP 5.6 to PHP 7.0
URI with ending colon without port
Thanks, @mtagliab! |
Based on issue #33
Previous behaviour
Which gives the following result:
New behaviour
With this fix, the new result will be:
which matches the result of
parse_url($uri)
.I also added a new test for this case.