Skip to content

Commit

Permalink
Removed dead code from Uri::parse and added missing phpdoc (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Mar 21, 2021
1 parent bfc9b5f commit 72dde17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ public function __construct($uri = '')
* @see https://www.php.net/manual/en/function.parse-url.php#114817
* @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING
*
* @param string $url
*
* @return array|false
*/
private static function parse($url, $component = -1)
private static function parse($url)
{
$encodedUrl = preg_replace_callback(
'%[^:/@?&=#]+%usD',
Expand All @@ -100,13 +102,13 @@ static function ($matches) {
$url
);

$result = parse_url($encodedUrl, $component);
$result = parse_url($encodedUrl);

if ($result === false) {
return false;
}

return is_array($result) ? array_map('urldecode', $result) : urldecode($result);
return array_map('urldecode', $result);
}

public function __toString()
Expand Down

0 comments on commit 72dde17

Please sign in to comment.