Code Duplication    Length = 18-18 lines in 2 locations

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

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