{"action":"created","issue":{"url":"https://api.github.com/repos/guzzle/psr7/issues/67","repository_url":"https://api.github.com/repos/guzzle/psr7","labels_url":"https://api.github.com/repos/guzzle/psr7/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/guzzle/psr7/issues/67/comments","events_url":"https://api.github.com/repos/guzzle/psr7/issues/67/events","html_url":"https://github.com/guzzle/psr7/issues/67","id":138132572,"number":67,"title":"I'd like Uri to be a little more explicit with port numbers","user":{"login":"timmillwood","id":151519,"avatar_url":"https://avatars.githubusercontent.com/u/151519?v=3","gravatar_id":"","url":"https://api.github.com/users/timmillwood","html_url":"https://github.com/timmillwood","followers_url":"https://api.github.com/users/timmillwood/followers","following_url":"https://api.github.com/users/timmillwood/following{/other_user}","gists_url":"https://api.github.com/users/timmillwood/gists{/gist_id}","starred_url":"https://api.github.com/users/timmillwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmillwood/subscriptions","organizations_url":"https://api.github.com/users/timmillwood/orgs","repos_url":"https://api.github.com/users/timmillwood/repos","events_url":"https://api.github.com/users/timmillwood/events{/privacy}","received_events_url":"https://api.github.com/users/timmillwood/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-03T09:58:04Z","updated_at":"2016-05-18T16:03:46Z","closed_at":"2016-05-18T11:50:51Z","body":"When doing the following, I'd expect it to return 80.\r\n```\r\n$uri = new Uri('http://example.com/foo/bar');\r\nreturn $uri->getPort();\r\n```\r\n\r\nOr if not then I should very much expect it when doing this.\r\n```\r\n$uri = new Uri('http://example.com/foo/bar');\r\nreturn $uri->withPort(80)->getPort();\r\n```"},"comment":{"url":"https://api.github.com/repos/guzzle/psr7/issues/comments/220075073","html_url":"https://github.com/guzzle/psr7/issues/67#issuecomment-220075073","issue_url":"https://api.github.com/repos/guzzle/psr7/issues/67","id":220075073,"user":{"login":"timmillwood","id":151519,"avatar_url":"https://avatars.githubusercontent.com/u/151519?v=3","gravatar_id":"","url":"https://api.github.com/users/timmillwood","html_url":"https://github.com/timmillwood","followers_url":"https://api.github.com/users/timmillwood/followers","following_url":"https://api.github.com/users/timmillwood/following{/other_user}","gists_url":"https://api.github.com/users/timmillwood/gists{/gist_id}","starred_url":"https://api.github.com/users/timmillwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmillwood/subscriptions","organizations_url":"https://api.github.com/users/timmillwood/orgs","repos_url":"https://api.github.com/users/timmillwood/repos","events_url":"https://api.github.com/users/timmillwood/events{/privacy}","received_events_url":"https://api.github.com/users/timmillwood/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T16:03:46Z","updated_at":"2016-05-18T16:03:46Z","body":"Right, currently I'm doing\r\n```\r\n$port = $uri->getPort();\r\nif (empty($port)) {\r\n    $port = ($uri->getScheme() == 'https') ? 443 : 80;\r\n}\r\n```"}}