Code Duplication    Length = 18-18 lines in 2 locations

controller/settingscontroller.php 2 locations

@@ 112-129 (lines=18) @@
109
	 * @param string $view
110
	 * @return JSONResponse
111
	 */
112
	private function setView($view) {
113
		if (!$this->isViewAllowed($view)) {
114
			return new JSONResponse([], Http::STATUS_UNPROCESSABLE_ENTITY);
115
		}
116
117
		try {
118
			$this->config->setUserValue(
119
				$this->userId,
120
				$this->appName,
121
				'currentView',
122
				$view
123
			);
124
		} catch(\Exception $e) {
125
			return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);
126
		}
127
128
		return new JSONResponse();
129
	}
130
131
132
	/**
@@ 176-193 (lines=18) @@
173
	 * @param $value
174
	 * @return JSONResponse
175
	 */
176
	private function setSkipPopover($value) {
177
		if (!$this->isSkipPopoverValueAllowed($value)) {
178
			return new JSONResponse([], Http::STATUS_UNPROCESSABLE_ENTITY);
179
		}
180
181
		try {
182
			$this->config->setUserValue(
183
				$this->userId,
184
				$this->appName,
185
				'skipPopover',
186
				$value
187
			);
188
		} catch(\Exception $e) {
189
			return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);
190
		}
191
192
		return new JSONResponse();
193
	}
194
195
	/**
196
	 * get if popover shall be skipped