Code Duplication    Length = 17-18 lines in 2 locations

lib/Controller/SettingsController.php 2 locations

@@ 147-164 (lines=18) @@
144
	 *
145
	 * @return DataResponse
146
	 */
147
	public function updateWebsiteTheme($siteId, $theme) {
148
149
		try {
150
			$website = $this->websitesService->getWebsiteFromId($siteId);
151
152
			$website->hasToBeOwnedBy($this->userId);
153
			$website->setTheme((string)$theme);
154
155
			$this->themesService->hasToBeAValidTheme($theme);
156
			$this->websitesService->updateWebsite($website);
157
158
			return $this->miscService->success(
159
				['websites' => $this->websitesService->getWebsitesFromUser($this->userId)]
160
			);
161
		} catch (Exception $e) {
162
			return $this->miscService->fail(['error' => $e->getMessage()]);
163
		}
164
	}
165
166
167
	/**
@@ 176-192 (lines=17) @@
173
	 *
174
	 * @return DataResponse
175
	 */
176
	public function editPersonalWebsiteOption($siteId, $option, $value) {
177
178
		try {
179
			$website = $this->websitesService->getWebsiteFromId($siteId);
180
181
			$website->hasToBeOwnedBy($this->userId);
182
			$website->setOption((string)$option, (string)$value);
183
184
			$this->websitesService->updateWebsite($website);
185
186
			return $this->miscService->success(
187
				['websites' => $this->websitesService->getWebsitesFromUser($this->userId)]
188
			);
189
		} catch (Exception $e) {
190
			return $this->miscService->fail(['error' => $e->getMessage()]);
191
		}
192
	}
193
194
195
	/**