diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index ecddc2c5..4f60f0fe 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -161,7 +161,7 @@ class Response extends HttpService implements ResponseInterface * @return Response * @throws Exception */ - public function getBuilder(mixed $data, SResponse $response = null): static + public function getBuilder(mixed $data, SResponse $response = null): ResponseInterface { if ($response != null) { $this->configure($response); @@ -195,14 +195,10 @@ class Response extends HttpService implements ResponseInterface /** * @param mixed $content - * @return Response|\Server\Constrict\Response + * @return ResponseInterface */ - public function setContent(mixed $content): Response|\Server\Constrict\Response + public function setContent(mixed $content): ResponseInterface { -// if ($content instanceof \Server\Constrict\Response -// || $content instanceof Response) { -// return $content; -// } $this->endData = $content; return $this; } diff --git a/Server/ExceptionHandlerDispatcher.php b/Server/ExceptionHandlerDispatcher.php index aa6320f5..1b85c35c 100644 --- a/Server/ExceptionHandlerDispatcher.php +++ b/Server/ExceptionHandlerDispatcher.php @@ -17,9 +17,9 @@ class ExceptionHandlerDispatcher implements ExceptionHandlerInterface /** * @param Throwable $exception * @param CResponse $response - * @return CResponse|\HttpServer\Http\Response + * @return ResponseInterface */ - public function emit(Throwable $exception, Response $response): Response|\HttpServer\Http\Response + public function emit(Throwable $exception, Response $response): ResponseInterface { if ($exception->getCode() == 404) { return $response->setContent($exception->getMessage()) diff --git a/Server/ExceptionHandlerInterface.php b/Server/ExceptionHandlerInterface.php index 4a8dfd60..c4f7409b 100644 --- a/Server/ExceptionHandlerInterface.php +++ b/Server/ExceptionHandlerInterface.php @@ -2,7 +2,6 @@ namespace Server; -use HttpServer\Http\Response as SResponse; use Server\Constrict\Response; use Throwable; @@ -16,8 +15,8 @@ interface ExceptionHandlerInterface /** * @param Throwable $exception * @param Response $response - * @return Response|SResponse + * @return ResponseInterface */ - public function emit(Throwable $exception, Response $response): Response|SResponse; + public function emit(Throwable $exception, Response $response): ResponseInterface; }