Code Duplication    Length = 7-7 lines in 2 locations

lib/Service/OcrService.php 2 locations

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