Code Duplication    Length = 7-7 lines in 2 locations

lib/Service/OcrService.php 2 locations

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