Skip to content

Commit ab2facc

Browse files
committed
fix: 兼容 UploadFile 类不存在时会报类型不匹配的问题
1 parent dd0f50c commit ab2facc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Integrations/Request.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@ public function rawBody(): string
104104
return $this->request->rawBody();
105105
}
106106

107+
/**
108+
* @return string|array|null|UploadFile
109+
*/
107110
/** @phpstan-ignore-next-line */
108-
public function postForm(string $key): null|string|array|UploadFile
111+
public function postForm(string $key): null|string|array|object
109112
{
110113
return $this->allPostForm()[$key] ?? null;
111114
}
@@ -186,8 +189,11 @@ public function rawBody(): string
186189
return $this->request->getContent();
187190
}
188191

192+
/**
193+
* @return string|array|null|UploadedFile
194+
*/
189195
/** @phpstan-ignore-next-line */
190-
public function postForm(string $key): null|string|array|UploadedFile
196+
public function postForm(string $key): null|string|array|object
191197
{
192198
return $this->allPostForm()[$key] ?? null;
193199
}

0 commit comments

Comments
 (0)