From da4f7319b7a38f0b818fedf87cd95951aa6d5362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 19 Mar 2021 18:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Http/HttpParams.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/HttpServer/Http/HttpParams.php b/HttpServer/Http/HttpParams.php index 48dc73e6..5107c2ef 100644 --- a/HttpServer/Http/HttpParams.php +++ b/HttpServer/Http/HttpParams.php @@ -207,12 +207,14 @@ class HttpParams /** * @param $name * @param bool $isNeed - * @return mixed + * @return array|null * @throws RequestException */ - private function required($name, $isNeed = false): mixed + private function required($name, $isNeed = false): ?array { - $int = $this->body[$name] ?? NULL; + $body = array_merge($this->body?? [], $this->socket ?? []); + + $int = $body ?? NULL; if (is_null($int) && $isNeed === true) { throw new RequestException("You need to add request parameter $name"); }