Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

@@ 800-817 (lines=18) @@
797
	 *
798
	 * @throws NotPermittedException
799
	 */
800
	private function extractContentFromFilePDF(FilesDocument $document, File $file) {
801
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) {
802
			return;
803
		}
804
805
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF);
806
		if (!$this->isSourceIndexable($document)) {
807
			return;
808
		}
809
810
		if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') {
811
			$document->setContent('');
812
813
			return;
814
		}
815
816
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
817
	}
818
819
820
	/**
@@ 826-843 (lines=18) @@
823
	 *
824
	 * @throws NotPermittedException
825
	 */
826
	private function extractContentFromFileOffice(FilesDocument $document, File $file) {
827
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) {
828
			return;
829
		}
830
831
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE);
832
		if (!$this->isSourceIndexable($document)) {
833
			return;
834
		}
835
836
		if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') {
837
			$document->setContent('');
838
839
			return;
840
		}
841
842
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
843
	}
844
845
846
	/**