Code Duplication    Length = 7-7 lines in 2 locations

lib/Service/OcrService.php 2 locations

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