Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

@@ 740-757 (lines=18) @@
737
	 *
738
	 * @throws NotPermittedException
739
	 */
740
	private function extractContentFromFilePDF(FilesDocument $document, File $file) {
741
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) {
742
			return;
743
		}
744
745
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF);
746
		if (!$this->isSourceIndexable($document)) {
747
			return;
748
		}
749
750
		if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') {
751
			$document->setContent('');
752
753
			return;
754
		}
755
756
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
757
	}
758
759
760
	/**
@@ 766-783 (lines=18) @@
763
	 *
764
	 * @throws NotPermittedException
765
	 */
766
	private function extractContentFromFileOffice(FilesDocument $document, File $file) {
767
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) {
768
			return;
769
		}
770
771
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE);
772
		if (!$this->isSourceIndexable($document)) {
773
			return;
774
		}
775
776
		if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') {
777
			$document->setContent('');
778
779
			return;
780
		}
781
782
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
783
	}
784
785
786
	/**