Skip to content

Commit 99e724e

Browse files
committed
Deprecate UriString::isValidHost method
1 parent b41dbcb commit 99e724e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Rfc3986/Uri.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Exception;
1717
use League\Uri\Encoder;
1818
use League\Uri\Exceptions\SyntaxError;
19+
use League\Uri\HostRecord;
1920
use League\Uri\UriString;
2021
use SensitiveParameter;
2122
use Uri\InvalidUriException;
@@ -322,7 +323,7 @@ public function withHost(?string $host): self
322323
return match (true) {
323324
null !== $host && str_contains($host, "\0") => throw new ValueError('Argument #1 ($host) must not contain any null bytes'),
324325
$host === $this->getRawHost() => $this,
325-
UriString::isValidHost($host) => $this->withComponent(['host' => $host]),
326+
HostRecord::validate($host) => $this->withComponent(['host' => $host]),
326327
default => throw new InvalidUriException('The host component value `'.$host.'` is not a valid host.'),
327328
};
328329
}

0 commit comments

Comments
 (0)