rootFolder ->getUserFolder($this->placeInfo->getUserId()) ->getById($this->file->getFileId()); $node = current($nodes); if ($node) { return $node; } else { throw new NotFoundException('Photo not found for user'); } } public function get() { $node = $this->getNode(); if ($node instanceof File) { return $node->fopen('r'); } else { throw new NotFoundException('Photo is a folder'); } } public function getFileInfo(): Node { return $this->getNode(); } }