deduplicate getStorage() logic in Mount\Manager

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2023-02-06 18:17:40 +01:00
parent 43589312cc
commit 9281359fa4

View file

@ -199,15 +199,7 @@ class MountPoint implements IMountPoint {
*/
public function getStorageId() {
if (!$this->storageId) {
if (is_null($this->storage)) {
$storage = $this->createStorage(); //FIXME: start using exceptions
if (is_null($storage)) {
return null;
}
$this->storage = $storage;
}
$this->storageId = $this->storage->getId();
$this->storageId = $this->getStorage()->getId();
if (strlen($this->storageId) > 64) {
$this->storageId = md5($this->storageId);
}