<?php
declare(strict_types=1);
namespace App\Shared\Domain\File;
use Symfony\Component\HttpFoundation\File\File as BaseFile;
final class File extends BaseFile implements \ArrayAccess
{
public function __construct(
private string $originalFilename,
private string $path,
private string $mimeType
) {
parent::__construct($path);
}
public function upload(FileUploaderInterface $fileUploader) : void
{
$this->path = $fileUploader->upload($this);
}
public function getClientOriginalName() : string
{
return $this->originalFilename;
}
public function getPath() : ?string
{
return $this->path;
}
public function getOriginalFilename() : string
{
return $this->originalFilename;
}
public function getMimeType() : string
{
return $this->mimeType;
}
public function offsetExists($offset)
{
// TODO: Implement offsetExists() method.
}
public function offsetGet($offset)
{
// TODO: Implement offsetGet() method.
}
public function offsetSet($offset, $value)
{
// TODO: Implement offsetSet() method.
}
public function offsetUnset($offset)
{
// TODO: Implement offsetUnset() method.
}
}