This commit is contained in:
2023-12-12 16:25:31 +08:00
parent cb20849494
commit 2030841322
4 changed files with 167 additions and 11 deletions
+8 -5
View File
@@ -64,19 +64,22 @@ class ConstrictRequest extends Message implements RequestInterface, ServerReques
/**
* @param string $name
* @return array|null
* @return File|null
*/
#[ArrayShape(['name' => 'string', 'type' => 'string', 'tmp_name' => 'string', 'error' => 'int', 'size' => 'int'])]
public function file(string $name): ?array
public function file(string $name): ?File
{
return $this->files[$name] ?? null;
if (isset($this->files[$name])) {
return new File($this->files[$name]);
} else {
return null;
}
}
/**
* @return bool
*/
public function getIsPost(): bool
public function isPost(): bool
{
return $this->method === 'POST';
}