Code Duplication    Length = 5-7 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 357-361 (lines=5) @@
354
				$view = new View('/' . $wopi->getOwnerUid());
355
				if ($view->file_exists($versionPath)){
356
					$info = $view->getFileInfo($versionPath);
357
					if ($info->getSize() === 0) {
358
						$response = new Http\Response();
359
					} else {
360
						$response = new StreamResponse($view->fopen($versionPath, 'rb'));
361
					}
362
				}
363
				else {
364
					return new JSONResponse([], Http::STATUS_NOT_FOUND);
@@ 367-373 (lines=7) @@
364
					return new JSONResponse([], Http::STATUS_NOT_FOUND);
365
				}
366
			}
367
			else {
368
				if ($file->getSize() === 0) {
369
					$response = new Http\Response();
370
				} else {
371
					$response = new StreamResponse($file->fopen('rb'));
372
				}
373
			}
374
			$response->addHeader('Content-Disposition', 'attachment');
375
			$response->addHeader('Content-Type', 'application/octet-stream');
376
			return $response;