Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 317-331 (lines=15) @@
314
		$mounts = array_reverse($mounts);
315
316
		$nodes = array();
317
		foreach ($mounts as $mount) {
318
			/**
319
			 * @var \OC\Files\Mount\MountPoint $mount
320
			 */
321
			if ($mount->getStorage()) {
322
				$cache = $mount->getStorage()->getCache();
323
				$internalPath = $cache->getPathById($id);
324
				if (is_string($internalPath)) {
325
					$fullPath = $mount->getMountPoint() . $internalPath;
326
					if (!is_null($path = $this->getRelativePath($fullPath))) {
327
						$nodes[] = $this->get($path);
328
					}
329
				}
330
			}
331
		}
332
		return $nodes;
333
	}
334

lib/private/files/view.php 1 location

@@ 1347-1361 (lines=15) @@
1344
		// reverse the array so we start with the storage this view is in
1345
		// which is the most likely to contain the file we're looking for
1346
		$mounts = array_reverse($mounts);
1347
		foreach ($mounts as $mount) {
1348
			/**
1349
			 * @var \OC\Files\Mount\MountPoint $mount
1350
			 */
1351
			if ($mount->getStorage()) {
1352
				$cache = $mount->getStorage()->getCache();
1353
				$internalPath = $cache->getPathById($id);
1354
				if (is_string($internalPath)) {
1355
					$fullPath = $mount->getMountPoint() . $internalPath;
1356
					if (!is_null($path = $this->getRelativePath($fullPath))) {
1357
						return $path;
1358
					}
1359
				}
1360
			}
1361
		}
1362
		return null;
1363
	}
1364