Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 326-343 (lines=18) @@
323
	 *
324
	 * @return FileDisplayResponse|NotFoundResponse
325
	 */
326
	public function getLogo() {
327
		try {
328
			/** @var File $file */
329
			$file = $this->appData->getFolder('images')->getFile('logo');
330
		} catch (NotFoundException $e) {
331
			return new NotFoundResponse();
332
		}
333
334
		$response = new FileDisplayResponse($file);
335
		$response->cacheFor(3600);
336
		$expires = new \DateTime();
337
		$expires->setTimestamp($this->timeFactory->getTime());
338
		$expires->add(new \DateInterval('PT24H'));
339
		$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
340
		$response->addHeader('Pragma', 'cache');
341
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'logoMime', ''));
342
		return $response;
343
	}
344
345
	/**
346
	 * @PublicPage
@@ 351-368 (lines=18) @@
348
	 *
349
	 * @return FileDisplayResponse|NotFoundResponse
350
	 */
351
	public function getLoginBackground() {
352
		try {
353
			/** @var File $file */
354
			$file = $this->appData->getFolder('images')->getFile('background');
355
		} catch (NotFoundException $e) {
356
			return new NotFoundResponse();
357
		}
358
359
		$response = new FileDisplayResponse($file);
360
		$response->cacheFor(3600);
361
		$expires = new \DateTime();
362
		$expires->setTimestamp($this->timeFactory->getTime());
363
		$expires->add(new \DateInterval('PT24H'));
364
		$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
365
		$response->addHeader('Pragma', 'cache');
366
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'backgroundMime', ''));
367
		return $response;
368
	}
369
370
	/**
371
	 * @NoCSRFRequired