Skip to content

Commit

Permalink
Normalizes component fromUri behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jul 6, 2024
1 parent 18b9afb commit 8c61389
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All Notable changes to `League\Uri\Interfaces` will be documented in this file
### Fixed

- Adding Host resolution caching to speed up URI parsing in `UriString`
- `UriString::parseAuthority` accepts `Stringable` object as valid input

### Deprecated

Expand Down
3 changes: 2 additions & 1 deletion UriString.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,14 @@ public static function parse(Stringable|string|int $uri): array
*
* @return AuthorityMap
*/
public static function parseAuthority(?string $authority): array
public static function parseAuthority(Stringable|string|null $authority): array
{
$components = ['user' => null, 'pass' => null, 'host' => null, 'port' => null];
if (null === $authority) {
return $components;
}

$authority = (string) $authority;
$components['host'] = '';
if ('' === $authority) {
return $components;
Expand Down

0 comments on commit 8c61389

Please sign in to comment.