Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

@@ 727-744 (lines=18) @@
724
	 *
725
	 * @throws NotPermittedException
726
	 */
727
	private function extractContentFromFilePDF(FilesDocument $document, File $file) {
728
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) {
729
			return;
730
		}
731
732
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF);
733
		if (!$this->isSourceIndexable($document)) {
734
			return;
735
		}
736
737
		if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') {
738
			$document->setContent('');
739
740
			return;
741
		}
742
743
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
744
	}
745
746
747
	/**
@@ 753-770 (lines=18) @@
750
	 *
751
	 * @throws NotPermittedException
752
	 */
753
	private function extractContentFromFileOffice(FilesDocument $document, File $file) {
754
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) {
755
			return;
756
		}
757
758
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE);
759
		if (!$this->isSourceIndexable($document)) {
760
			return;
761
		}
762
763
		if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') {
764
			$document->setContent('');
765
766
			return;
767
		}
768
769
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
770
	}
771
772
773
	/**