Skip to content

Commit

Permalink
Renamed to UriInterface::getComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jul 30, 2023
1 parent aaf8191 commit 23dc7e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ private function formatPort(int|null $port = null): ?int
*/
public static function new(Stringable|string $uri = ''): self
{
$components = $uri instanceof UriInterface ? $uri->components() : UriString::parse($uri);
$components = $uri instanceof UriInterface ? $uri->getComponents() : UriString::parse($uri);

return new self(
$components['scheme'],
Expand Down Expand Up @@ -457,7 +457,7 @@ public static function fromBaseUri(Stringable|String $uri, Stringable|String|nul
public static function fromTemplate(Stringable|string $template, iterable $variables = []): self
{
return match (true) {
$template instanceof UriTemplate => self::fromComponents($template->expand($variables)->components()),
$template instanceof UriTemplate => self::fromComponents($template->expand($variables)->getComponents()),
$template instanceof UriTemplate\Template => self::new($template->expand($variables)),
default => self::new(UriTemplate\Template::new($template)->expand($variables)),
};
Expand Down Expand Up @@ -998,7 +998,7 @@ public function jsonSerialize(): string
/**
* @return ComponentMap
*/
public function components(): array
public function getComponents(): array
{
[$user, $pass] = null !== $this->userInfo ? explode(':', $this->userInfo) : [null, null];

Expand Down
2 changes: 1 addition & 1 deletion UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testAutomaticUrlNormalization(): void
$uri = Uri::new($raw);

self::assertSame($normalized, $uri->toString());
self::assertSame($components, $uri->components());
self::assertSame($components, $uri->getComponents());
}

public function testAutomaticUrlNormalizationBis(): void
Expand Down

0 comments on commit 23dc7e7

Please sign in to comment.