Code Duplication    Length = 11-13 lines in 2 locations

lib/private/App/AppManager.php 2 locations

@@ 226-238 (lines=13) @@
223
	 * @param string $appId
224
	 * @throws \Exception
225
	 */
226
	public function enableApp($appId) {
227
		if($this->getAppPath($appId) === false) {
228
			throw new \Exception("$appId can't be enabled since it is not installed.");
229
		}
230
		$this->canEnableTheme($appId);
231
232
		$this->installedAppsCache[$appId] = 'yes';
233
		$this->appConfig->setValue($appId, 'enabled', 'yes');
234
		$this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent(
235
			ManagerEvent::EVENT_APP_ENABLE, $appId
236
		));
237
		$this->clearAppsCache();
238
	}
239
240
	/**
241
	 * Do not allow more than one active app-theme
@@ 306-316 (lines=11) @@
303
	 * @param string $appId
304
	 * @throws \Exception if app can't be disabled
305
	 */
306
	public function disableApp($appId) {
307
		if ($this->isAlwaysEnabled($appId)) {
308
			throw new \Exception("$appId can't be disabled.");
309
		}
310
		unset($this->installedAppsCache[$appId]);
311
		$this->appConfig->setValue($appId, 'enabled', 'no');
312
		$this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent(
313
			ManagerEvent::EVENT_APP_DISABLE, $appId
314
		));
315
		$this->clearAppsCache();
316
	}
317
318
	/**
319
	 * Clear the cached list of apps when enabling/disabling an app