Code Duplication    Length = 5-8 lines in 2 locations

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

@@ 145-152 (lines=8) @@
142
	 */
143
	protected function validate(StorageConfig $storage) {
144
		$mountPoint = $storage->getMountPoint();
145
		if ($mountPoint === '' || $mountPoint === '/') {
146
			return new DataResponse(
147
				[
148
					'message' => (string)$this->l10n->t('Invalid mount point')
149
				],
150
				Http::STATUS_UNPROCESSABLE_ENTITY
151
			);
152
		}
153
154
		if ($storage->getBackendOption('objectstore')) {
155
			// objectstore must not be sent from client side

settings/Controller/LogSettingsController.php 1 location

@@ 74-78 (lines=5) @@
71
	 * @return JSONResponse
72
	 */
73
	public function setLogLevel($level) {
74
		if ($level < 0 || $level > 4) {
75
			return new JSONResponse([
76
				'message' => (string) $this->l10n->t('log-level out of allowed range'),
77
			], Http::STATUS_BAD_REQUEST);
78
		}
79
80
		$this->config->setSystemValue('loglevel', $level);
81
		return new JSONResponse([