Code Duplication    Length = 11-12 lines in 2 locations

apps/files_external/lib/Lib/Storage/Swift.php 1 location

@@ 86-96 (lines=11) @@
83
	/**
84
	 * @param string $path
85
	 */
86
	private function normalizePath($path) {
87
		$path = \trim($path, '/');
88
89
		if (!$path) {
90
			$path = '.';
91
		}
92
93
		$path = \str_replace('#', '%23', $path);
94
95
		return $path;
96
	}
97
98
	const SUBCONTAINER_FILE = '.subcontainers';
99

lib/private/Files/ObjectStore/ObjectStoreStorage.php 1 location

@@ 550-561 (lines=12) @@
547
	 * @param string $path
548
	 * @return string
549
	 */
550
	private function normalizePath($path) {
551
		$path = \trim($path, '/');
552
		//FIXME why do we sometimes get a path like 'files//username'?
553
		$path = \str_replace('//', '/', $path);
554
555
		// dirname('/folder') returns '.' but internally (in the cache) we store the root as ''
556
		if (!$path || $path === '.') {
557
			$path = '';
558
		}
559
560
		return $path;
561
	}
562
563
	/**
564
	 * Clear all object stat cache entries under this path