Code Duplication    Length = 16-16 lines in 2 locations

apps/theming/lib/Controller/ThemingController.php 2 locations

@@ 263-278 (lines=16) @@
260
	 *
261
	 * @return StreamResponse|NotFoundResponse
262
	 */
263
	public function getLogo() {
264
		try {
265
			/** @var File $file */
266
			$file = $this->rootFolder->get('themedinstancelogo');
267
		} catch (NotFoundException $e) {
268
			return new NotFoundResponse();
269
		}
270
271
		$response = new Http\StreamResponse($file->fopen('r'));
272
		$response->cacheFor(3600);
273
		$response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
274
		$response->addHeader('Content-Disposition', 'attachment');
275
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'logoMime', ''));
276
		$response->addHeader('Pragma', 'cache');
277
		return $response;
278
	}
279
280
	/**
281
	 * @PublicPage
@@ 286-301 (lines=16) @@
283
	 *
284
	 * @return StreamResponse|NotFoundResponse
285
	 */
286
	public function getLoginBackground() {
287
		try {
288
			/** @var File $file */
289
			$file = $this->rootFolder->get('themedbackgroundlogo');
290
		} catch (NotFoundException $e) {
291
			return new NotFoundResponse();
292
		}
293
294
		$response = new StreamResponse($file->fopen('r'));
295
		$response->cacheFor(3600);
296
		$response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
297
		$response->addHeader('Content-Disposition', 'attachment');
298
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'backgroundMime', ''));
299
		$response->addHeader('Pragma', 'cache');
300
		return $response;
301
	}
302
303
	/**
304
	 * @NoCSRFRequired