Code Duplication    Length = 19-21 lines in 2 locations

apps/files_external/lib/Controller/StoragesController.php 1 location

@@ 300-318 (lines=19) @@
297
	 *
298
	 * @return DataResponse
299
	 */
300
	public function show($id, $testOnly = true) {
301
		try {
302
			$storage = $this->service->getStorage($id);
303
304
			$this->updateStorageStatus($storage, $testOnly);
305
		} catch (NotFoundException $e) {
306
			return new DataResponse(
307
				[
308
					'message' => (string)$this->l10n->t('Storage with id "%i" not found', [$id])
309
				],
310
				Http::STATUS_NOT_FOUND
311
			);
312
		}
313
314
		return new DataResponse(
315
			$storage,
316
			Http::STATUS_OK
317
		);
318
	}
319
320
	/**
321
	 * Deletes the storage with the given id.

apps/files_external/lib/Controller/UserGlobalStoragesController.php 1 location

@@ 116-136 (lines=21) @@
113
	 *
114
	 * @NoAdminRequired
115
	 */
116
	public function show($id, $testOnly = true) {
117
		try {
118
			$storage = $this->service->getStorage($id);
119
120
			$this->updateStorageStatus($storage, $testOnly);
121
		} catch (NotFoundException $e) {
122
			return new DataResponse(
123
				[
124
					'message' => (string)$this->l10n->t('Storage with id "%i" not found', [$id])
125
				],
126
				Http::STATUS_NOT_FOUND
127
			);
128
		}
129
130
		$this->sanitizeStorage($storage);
131
132
		return new DataResponse(
133
			$storage,
134
			Http::STATUS_OK
135
		);
136
	}
137
138
	/**
139
	 * Update an external storage entry.