Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 367-384 (lines=18) @@
364
	 *
365
	 * @return FileDisplayResponse|NotFoundResponse
366
	 */
367
	public function getLogo() {
368
		try {
369
			/** @var File $file */
370
			$file = $this->appData->getFolder('images')->getFile('logo');
371
		} catch (NotFoundException $e) {
372
			return new NotFoundResponse();
373
		}
374
375
		$response = new FileDisplayResponse($file);
376
		$response->cacheFor(3600);
377
		$expires = new \DateTime();
378
		$expires->setTimestamp($this->timeFactory->getTime());
379
		$expires->add(new \DateInterval('PT24H'));
380
		$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
381
		$response->addHeader('Pragma', 'cache');
382
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'logoMime', ''));
383
		return $response;
384
	}
385
386
	/**
387
	 * @PublicPage
@@ 392-409 (lines=18) @@
389
	 *
390
	 * @return FileDisplayResponse|NotFoundResponse
391
	 */
392
	public function getLoginBackground() {
393
		try {
394
			/** @var File $file */
395
			$file = $this->appData->getFolder('images')->getFile('background');
396
		} catch (NotFoundException $e) {
397
			return new NotFoundResponse();
398
		}
399
400
		$response = new FileDisplayResponse($file);
401
		$response->cacheFor(3600);
402
		$expires = new \DateTime();
403
		$expires->setTimestamp($this->timeFactory->getTime());
404
		$expires->add(new \DateInterval('PT24H'));
405
		$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
406
		$response->addHeader('Pragma', 'cache');
407
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'backgroundMime', ''));
408
		return $response;
409
	}
410
411
	/**
412
	 * @NoCSRFRequired