Code Duplication    Length = 7-7 lines in 2 locations

lib/Service/OcrService.php 2 locations

@@ 339-345 (lines=7) @@
336
				$filePath = substr_replace($filePath, '', $pos, strlen('/')); // '/' => '' || '/Test/' => 'Test'
337
			}
338
339
			if ($fileInfo->getMimetype() === $this::MIMETYPE_PDF) {
340
				// PDFs:
341
				return \OCP\Files::buildNotExistingFileName($filePath, $fileName . '_OCR.pdf');
342
			} else {
343
				// IMAGES:
344
				return \OCP\Files::buildNotExistingFileName($filePath, $fileName . '_OCR.txt');
345
			}
346
		} catch (Exception $e) {
347
			$this->handleException($e);
348
		}
@@ 380-386 (lines=7) @@
377
				$filePath = substr_replace($filePath, '', $pos, strlen('/')); // '/Test' => '// 'Test' || '/' => ''
378
			}
379
380
			if ($fileInfo->getMimetype() === $this::MIMETYPE_PDF) {
381
				// PDFs:
382
				return \OCP\Files::buildNotExistingFileName($filePath, $fileName . '_OCR.pdf');
383
			} else {
384
				// IMAGES:
385
				return \OCP\Files::buildNotExistingFileName($filePath, $fileName . '_OCR.txt');
386
			}
387
		} catch (Exception $e) {
388
			$this->handleException($e);
389
		}