Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

@@ 711-728 (lines=18) @@
708
	 *
709
	 * @throws NotPermittedException
710
	 */
711
	private function extractContentFromFilePDF(FilesDocument $document, File $file) {
712
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) {
713
			return;
714
		}
715
716
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF);
717
		if (!$this->isSourceIndexable($document)) {
718
			return;
719
		}
720
721
		if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') {
722
			$document->setContent('');
723
724
			return;
725
		}
726
727
		$document->setContent(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
728
	}
729
730
731
	/**
@@ 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(base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64);
754
	}
755
756
757
	/**