浏览代码

fix header return type

walkor 2 年之前
父节点
当前提交
d46a0c1621
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/Protocols/Http/Request.php

+ 4 - 4
src/Protocols/Http/Request.php

@@ -129,9 +129,9 @@ class Request
      *
      * @param string|null $name
      * @param mixed|null $default
-     * @return string|null|array
+     * @return array|string|null
      */
-    public function post(string $name = null, mixed $default = null): string|null|array
+    public function post(string $name = null, mixed $default = null): array|string|null
     {
         if (!isset($this->data['post'])) {
             $this->parsePost();
@@ -147,9 +147,9 @@ class Request
      *
      * @param string|null $name
      * @param mixed|null $default
-     * @return string|null
+     * @return array|string|null
      */
-    public function header(string $name = null, mixed $default = null): ?string
+    public function header(string $name = null, mixed $default = null): array|string|null
     {
         if (!isset($this->data['headers'])) {
             $this->parseHeaders();