diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c51f1ea..db2d37efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All Notable changes to `League\Uri` will be documented in this file - `Uri::when` conditional method to ease component building logic. - `Uri` implements the new `League\Uri\Contract\UriInspector` interface - `Uri` implements the new `League\Uri\Contract\UriRenderer` interface +- `Uri::getUser` returns the encoded user component of the URI an alias for `Uri::getUsername` ### Fixed diff --git a/Uri.php b/Uri.php index a6a85926a..b0e34fad5 100644 --- a/Uri.php +++ b/Uri.php @@ -1322,13 +1322,26 @@ public function getAuthority(): ?string } /** - * * @see https://wiki.php.net/rfc/url_parsing_api + * Returns the user component encoded value. + * + * @see https://wiki.php.net/rfc/url_parsing_api */ public function getUser(): ?string { return $this->user; } + /** + * Returns the user component encoded value. + * + * @codeCoverageIgnore + * @see Uri::getUser() + */ + public function getUsername(): ?string + { + return $this->getUser(); + } + public function getPassword(): ?string { return $this->pass; @@ -1964,19 +1977,4 @@ public static function createFromServer(array $server): self { return self::fromServer($server); } - - /** - * DEPRECATION WARNING! This method will be removed in the next major point release. - * - * @deprecated Since version 7.6.0 - * @codeCoverageIgnore - * @see Uri::getUser() - * - * Retuns the user component encoded value. - */ - #[Deprecated(message:'use League\Uri\Uri::getUser() instead', since:'league/uri:7.6.0')] - public function getUsername(): ?string - { - return $this->getUser(); - } }