This commit is contained in:
2021-03-19 18:31:22 +08:00
parent da4f7319b7
commit 884734dafa
+3 -3
View File
@@ -207,14 +207,14 @@ class HttpParams
/**
* @param $name
* @param bool $isNeed
* @return array|null
* @return mixed
* @throws RequestException
*/
private function required($name, $isNeed = false): ?array
private function required($name, $isNeed = false): mixed
{
$body = array_merge($this->body?? [], $this->socket ?? []);
$int = $body ?? NULL;
$int = $body[$name] ?? NULL;
if (is_null($int) && $isNeed === true) {
throw new RequestException("You need to add request parameter $name");
}