Code Duplication    Length = 15-15 lines in 2 locations

lib/private/files/node/folder.php 1 location

@@ 273-287 (lines=15) @@
270
		$mounts = array_reverse($mounts);
271
272
		$nodes = array();
273
		foreach ($mounts as $mount) {
274
			/**
275
			 * @var \OC\Files\Mount\MountPoint $mount
276
			 */
277
			if ($mount->getStorage()) {
278
				$cache = $mount->getStorage()->getCache();
279
				$internalPath = $cache->getPathById($id);
280
				if (is_string($internalPath)) {
281
					$fullPath = $mount->getMountPoint() . $internalPath;
282
					if (!is_null($path = $this->getRelativePath($fullPath))) {
283
						$nodes[] = $this->get($path);
284
					}
285
				}
286
			}
287
		}
288
		return $nodes;
289
	}
290

lib/private/files/view.php 1 location

@@ 1578-1592 (lines=15) @@
1575
		// reverse the array so we start with the storage this view is in
1576
		// which is the most likely to contain the file we're looking for
1577
		$mounts = array_reverse($mounts);
1578
		foreach ($mounts as $mount) {
1579
			/**
1580
			 * @var \OC\Files\Mount\MountPoint $mount
1581
			 */
1582
			if ($mount->getStorage()) {
1583
				$cache = $mount->getStorage()->getCache();
1584
				$internalPath = $cache->getPathById($id);
1585
				if (is_string($internalPath)) {
1586
					$fullPath = $mount->getMountPoint() . $internalPath;
1587
					if (!is_null($path = $this->getRelativePath($fullPath))) {
1588
						return $path;
1589
					}
1590
				}
1591
			}
1592
		}
1593
		return null;
1594
	}
1595