/**
* @var InMemoryFile[]
*/
private array
$files =
[];
private readonly FinfoMimeTypeDetector|MimeTypeDetector
$mimeTypeDetector;
public function __construct( private readonly string
$defaultVisibility = Visibility::
PUBLIC,
?MimeTypeDetector
$mimeTypeDetector = null
) { $this->mimeTypeDetector =
$mimeTypeDetector ?:
new FinfoMimeTypeDetector();
} public function fileExists(string
$path): bool
{ return \
array_key_exists($this->
preparePath($path),
$this->files
);
} public function write(string
$path, string
$contents, Config
$config): void
{ $path =
$this->
preparePath($path);
$file =
$this->files
[$path] ??=
new InMemoryFile();