Skip to content

Commit

Permalink
SUPPORTED_SCHEME -> SUPPORTED_SCHEMES
Browse files Browse the repository at this point in the history
  • Loading branch information
Stilch committed Apr 27, 2021
1 parent bb09289 commit c60f0a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class Uri implements UriInterface
{
protected const SUPPORTED_SCHEME = [
protected const SUPPORTED_SCHEMES = [
'' => null,
'http' => 80,
'https' => 443
Expand Down Expand Up @@ -140,7 +140,7 @@ public function withScheme($scheme)
* @return string
*
* @throws InvalidArgumentException If the Uri scheme is not a string.
* @throws InvalidArgumentException If Uri scheme is not exists in SUPPORTED_SCHEME
* @throws InvalidArgumentException If Uri scheme is not exists in SUPPORTED_SCHEMES
*/
protected function filterScheme($scheme): string
{
Expand All @@ -149,9 +149,9 @@ protected function filterScheme($scheme): string
}

$scheme = str_replace('://', '', strtolower($scheme));
if (!key_exists($scheme, self::SUPPORTED_SCHEME)) {
if (!key_exists($scheme, self::SUPPORTED_SCHEMES)) {
throw new InvalidArgumentException(
'Uri scheme must be one of: "' . implode('", "', array_keys(static::SUPPORTED_SCHEME)) . '"'
'Uri scheme must be one of: "' . implode('", "', array_keys(static::SUPPORTED_SCHEMES)) . '"'
);
}

Expand Down Expand Up @@ -302,7 +302,7 @@ public function withPort($port)
*/
protected function hasStandardPort(): bool
{
return static::SUPPORTED_SCHEME[$this->scheme] === $this->port;
return static::SUPPORTED_SCHEMES[$this->scheme] === $this->port;
}

/**
Expand Down

0 comments on commit c60f0a3

Please sign in to comment.