Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

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