Code Duplication    Length = 13-13 lines in 2 locations

lib/private/Files/External/Service/GlobalStoragesService.php 1 location

@@ 173-185 (lines=13) @@
170
	 *
171
	 * @return array map of storage id to storage config
172
	 */
173
	public function getStorageForAllUsers() {
174
		$mounts = $this->dbConfig->getAllMounts();
175
		$configs = \array_map([$this, 'getStorageConfigFromDBMount'], $mounts);
176
		$configs = \array_filter($configs, function ($config) {
177
			return $config instanceof IStorageConfig;
178
		});
179
180
		$keys = \array_map(function (IStorageConfig $config) {
181
			return $config->getId();
182
		}, $configs);
183
184
		return \array_combine($keys, $configs);
185
	}
186
187
	/**
188
	 * Deletes the external storages mounted to the user

lib/private/Files/External/Service/StoragesService.php 1 location

@@ 128-140 (lines=13) @@
125
	 *
126
	 * @return array map of storage id to storage config
127
	 */
128
	protected function readConfig() {
129
		$mounts = $this->readDBConfig();
130
		$configs = \array_map([$this, 'getStorageConfigFromDBMount'], $mounts);
131
		$configs = \array_filter($configs, function ($config) {
132
			return $config instanceof IStorageConfig;
133
		});
134
135
		$keys = \array_map(function (IStorageConfig $config) {
136
			return $config->getId();
137
		}, $configs);
138
139
		return \array_combine($keys, $configs);
140
	}
141
142
	/**
143
	 * Get a storage with status