Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

@@ 737-754 (lines=18) @@
734
	 *
735
	 * @throws NotPermittedException
736
	 */
737
	private function extractContentFromFileOffice(FilesDocument $document, File $file) {
738
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) {
739
			return;
740
		}
741
742
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE);
743
		if (!$this->isSourceIndexable($document)) {
744
			return;
745
		}
746
747
		if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') {
748
			$document->setContent('');
749
750
			return;
751
		}
752
753
		$document->setContent(
754
			base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64
755
		);
756
	}
757
@@ 709-726 (lines=18) @@
706
	 *
707
	 * @throws NotPermittedException
708
	 */
709
	private function extractContentFromFilePDF(FilesDocument $document, File $file) {
710
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) {
711
			return;
712
		}
713
714
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF);
715
		if (!$this->isSourceIndexable($document)) {
716
			return;
717
		}
718
719
		if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') {
720
			$document->setContent('');
721
722
			return;
723
		}
724
725
		$document->setContent(
726
			base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64
727
		);
728
	}
729