Code Duplication    Length = 10-10 lines in 3 locations

lib/private/Files/ObjectStore/ObjectStoreStorage.php 3 locations

@@ 362-371 (lines=10) @@
359
		return false;
360
	}
361
362
	public function saveVersion($internalPath) {
363
		if ($this->objectStore instanceof IVersionedObjectStorage) {
364
			$stat = $this->stat($internalPath);
365
			// There are cases in the current implementation where saveVersion
366
			// is called before the file was even written.
367
			// There is nothing to be done in this case.
368
			// We return true to not trigger the fallback implementation
369
			if ($stat === false) {
370
				return true;
371
			}
372
			return $this->objectStore->saveVersion($this->getURN($stat['fileid']));
373
		}
374
		return parent::saveVersion($internalPath);
@@ 411-420 (lines=10) @@
408
		return parent::getVersion($internalPath, $versionId);
409
	}
410
411
	public function getContentOfVersion($internalPath, $versionId) {
412
		if ($this->objectStore instanceof IVersionedObjectStorage) {
413
			$stat = $this->stat($internalPath);
414
			if ($stat === false) {
415
				throw new NotFoundException();
416
			}
417
			return $this->objectStore->getContentOfVersion($this->getURN($stat['fileid']), $versionId);
418
		}
419
		return parent::getContentOfVersion($internalPath, $versionId);
420
	}
421
422
	public function restoreVersion($internalPath, $versionId) {
423
		if ($this->objectStore instanceof IVersionedObjectStorage) {
@@ 422-431 (lines=10) @@
419
		return parent::getContentOfVersion($internalPath, $versionId);
420
	}
421
422
	public function restoreVersion($internalPath, $versionId) {
423
		if ($this->objectStore instanceof IVersionedObjectStorage) {
424
			$stat = $this->stat($internalPath);
425
			if ($stat === false) {
426
				throw new NotFoundException();
427
			}
428
			return $this->objectStore->restoreVersion($this->getURN($stat['fileid']), $versionId);
429
		}
430
		return parent::restoreVersion($internalPath, $versionId);
431
	}
432
433
	public function readFile(string $path, array $options = []): StreamInterface {
434
		$stat = $this->stat($path);