Code Duplication    Length = 18-18 lines in 2 locations

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

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