Adress feedback :)

This commit is contained in:
Philipp 2021-10-05 19:06:13 +02:00
parent aebbbbba28
commit ccd8895237
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 26 additions and 4 deletions

View file

@ -45,11 +45,17 @@ class Filesystem implements IWritableStorage
* Filesystem constructor.
*
* @param string $filesystemPath
*
* @throws StorageException in case the path doesn't exist or isn't writeable
*/
public function __construct(string $filesystemPath = FilesystemConfig::DEFAULT_BASE_FOLDER)
{
$path = $filesystemPath;
$this->basePath = rtrim($path, '/');
if (!is_dir($this->basePath) || !is_writable($this->basePath)) {
throw new StorageException(sprintf('Path %s does not exist or is not writeable', $this->basePath));
}
}
/**