Update UploadedFile.php

This commit is contained in:
Jerry Ma 2023-06-02 12:56:54 +08:00 committed by GitHub
parent a253ddfb29
commit 103e88977c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,8 @@ class UploadedFile implements UploadedFileInterface
*/
private $file;
private string $key;
private bool $moved = false;
private ?int $size;
@ -45,12 +47,18 @@ class UploadedFile implements UploadedFileInterface
$this->client_media_type = $this->fileinfo['type'] ?? null;
$this->error = $this->fileinfo['error'];
$this->size = $this->fileinfo['size'];
$this->key = $this->fileinfo['key'];
if ($this->isOk()) {
$this->file = $this->fileinfo['tmp_name'];
}
}
public function getKey(): string
{
return $this->key;
}
public function isMoved(): bool
{
return $this->moved;