diff --git a/HttpServer/Http/HttpHeaders.php b/HttpServer/Http/HttpHeaders.php index d3c84e12..83226507 100644 --- a/HttpServer/Http/HttpHeaders.php +++ b/HttpServer/Http/HttpHeaders.php @@ -100,7 +100,7 @@ trait HttpHeaders */ public function exists($name): bool { - return $this->_headers[$name] ?? null === null; + return ($this->_headers[$name] ?? null) === null; } diff --git a/HttpServer/Http/Request.php b/HttpServer/Http/Request.php index 6b1733f1..7ed507d5 100644 --- a/HttpServer/Http/Request.php +++ b/HttpServer/Http/Request.php @@ -366,7 +366,7 @@ class Request extends HttpService implements RequestInterface /** * @return mixed|null */ - public function getIp(): string|null + #[Pure] public function getIp(): string|null { $headers = $this->getHeaders(); if (!empty($headers['remoteip'])) return $headers['remoteip']; diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index 53cfb25c..66364e90 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -524,7 +524,6 @@ class Router extends HttpService implements RouterInterface * @param RequestInterface $request * @return Node|null * 树杈搜索 - * @throws RequestException */ public function Branch_search(RequestInterface $request): ?Node {