Code Duplication    Length = 18-18 lines in 2 locations

lib/Service/FilesService.php 2 locations

@@ 706-723 (lines=18) @@
703
	 *
704
	 * @throws NotPermittedException
705
	 */
706
	private function extractContentFromFilePDF(FilesDocument $document, File $file) {
707
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) {
708
			return;
709
		}
710
711
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF);
712
		if (!$this->isSourceIndexable($document)) {
713
			return;
714
		}
715
716
		if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') {
717
			$document->setContent('');
718
719
			return;
720
		}
721
722
		$document->setContent(
723
			base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64
724
		);
725
	}
726
@@ 734-751 (lines=18) @@
731
	 *
732
	 * @throws NotPermittedException
733
	 */
734
	private function extractContentFromFileOffice(FilesDocument $document, File $file) {
735
		if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) {
736
			return;
737
		}
738
739
		$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE);
740
		if (!$this->isSourceIndexable($document)) {
741
			return;
742
		}
743
744
		if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') {
745
			$document->setContent('');
746
747
			return;
748
		}
749
750
		$document->setContent(
751
			base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64
752
		);
753
	}
754