chore: Проверки к типам

This commit is contained in:
origami11@yandex.ru 2025-12-01 19:44:22 +03:00
parent 5d3fae4249
commit 8786e84568
12 changed files with 41 additions and 47 deletions

View file

@ -73,7 +73,11 @@ class HttpRequest
public function setUrl($url): void
{
$this->url = $url;
$this->host = parse_url($this->url, PHP_URL_HOST);
$host = parse_url($this->url, PHP_URL_HOST);
if (!$host) {
throw new \RuntimeException("Не удалось получить хост");
}
$this->host = $host;
}
public function getUrl(): string