Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 286-303 (lines=18) @@
283
	 *
284
	 * @return FileDisplayResponse|NotFoundResponse
285
	 */
286
	public function getLogo() {
287
		try {
288
			/** @var File $file */
289
			$file = $this->appData->getFolder('images')->getFile('logo');
290
		} catch (NotFoundException $e) {
291
			return new NotFoundResponse();
292
		}
293
294
		$response = new FileDisplayResponse($file);
295
		$response->cacheFor(3600);
296
		$expires = new \DateTime();
297
		$expires->setTimestamp($this->timeFactory->getTime());
298
		$expires->add(new \DateInterval('PT24H'));
299
		$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
300
		$response->addHeader('Pragma', 'cache');
301
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'logoMime', ''));
302
		return $response;
303
	}
304
305
	/**
306
	 * @PublicPage
@@ 311-328 (lines=18) @@
308
	 *
309
	 * @return FileDisplayResponse|NotFoundResponse
310
	 */
311
	public function getLoginBackground() {
312
		try {
313
			/** @var File $file */
314
			$file = $this->appData->getFolder('images')->getFile('background');
315
		} catch (NotFoundException $e) {
316
			return new NotFoundResponse();
317
		}
318
319
		$response = new FileDisplayResponse($file);
320
		$response->cacheFor(3600);
321
		$expires = new \DateTime();
322
		$expires->setTimestamp($this->timeFactory->getTime());
323
		$expires->add(new \DateInterval('PT24H'));
324
		$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
325
		$response->addHeader('Pragma', 'cache');
326
		$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, 'backgroundMime', ''));
327
		return $response;
328
	}
329
330
	/**
331
	 * @NoCSRFRequired