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(
744
			base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64
745
		);
746
	}
747
@@ 755-772 (lines=18) @@
752
	 *
753
	 * @throws NotPermittedException
754
	 */
755
	private function extractContentFromFileOffice(FilesDocument $document, File $file) {
756
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) {
757
			return;
758
		}
759
760
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE);
761
		if (!$this->isSourceIndexable($document)) {
762
			return;
763
		}
764
765
		if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') {
766
			$document->setContent('');
767
768
			return;
769
		}
770
771
		$document->setContent(
772
			base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64
773
		);
774
	}
775