$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();
$file->
updateContents($contents,
$config->
get('timestamp'
));
$visibility =
$config->
get(Config::OPTION_VISIBILITY,
$this->defaultVisibility
);
$file->
setVisibility($visibility);
} public function writeStream(string
$path,
$contents, Config
$config): void
{ $this->
write($path,
(string) stream_get_contents($contents),
$config);
}