Completed
Pull Request — master (#158)
by
unknown
41s
created
lib/Service/FilesService.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1047,17 +1047,17 @@
 block discarded – undo
1047 1047
 				$content = '';
1048 1048
 
1049 1049
 				foreach ($xml->diagram as $child) {
1050
-				    $deflated_content = (string)$child;
1051
-				    $base64decoded = base64_decode($deflated_content);
1052
-				    $urlencoded_content = gzinflate($base64decoded);
1053
-				    $urldecoded_content = urldecode($urlencoded_content);
1050
+					$deflated_content = (string)$child;
1051
+					$base64decoded = base64_decode($deflated_content);
1052
+					$urlencoded_content = gzinflate($base64decoded);
1053
+					$urldecoded_content = urldecode($urlencoded_content);
1054 1054
 
1055
-				    // Remove image tag
1056
-				    $diagram_str = preg_replace('/style=\"shape=image[^"]*\"/', '', $urldecoded_content);
1055
+					// Remove image tag
1056
+					$diagram_str = preg_replace('/style=\"shape=image[^"]*\"/', '', $urldecoded_content);
1057 1057
 
1058
-				    // Construct XML
1059
-				    $diagram_xml = simplexml_load_string($diagram_str);
1060
-				    $content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml);
1058
+					// Construct XML
1059
+					$diagram_xml = simplexml_load_string($diagram_str);
1060
+					$content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml);
1061 1061
 				}
1062 1062
 
1063 1063
 			} catch (\Throwable $t) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 									  ->get($indexOptions->getOption('path', '/'));
235 235
 		} catch (Throwable $e) {
236 236
 			$this->e($e, ['userId' => $userId, 'options' => $indexOptions]);
237
-			\OC::$server->getLogger()->log(2, 'Issue while retrieving rootFolder for ' . $userId);
237
+			\OC::$server->getLogger()->log(2, 'Issue while retrieving rootFolder for '.$userId);
238 238
 
239 239
 			return [];
240 240
 		}
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 		$tagIds = $this->systemTagObjectMapper->getTagIdsForObjects([$file->getId()], 'files');
486 486
 		if (array_key_exists($file->getId(), $tagIds)) {
487 487
 			$tags = array_values(
488
-				array_map(function (ISystemTag $tag): string {
488
+				array_map(function(ISystemTag $tag): string {
489 489
 					return $tag->getName();
490 490
 				}, $this->systemTagManager->getTagsByIds($tagIds[$file->getId()]))
491 491
 			);
@@ -621,8 +621,8 @@  discard block
 block discarded – undo
621 621
 			$document->getIndex()
622 622
 					 ->setStatus(IIndex::INDEX_IGNORE);
623 623
 			$this->miscService->log(
624
-				'Exception while generateDocument: ' . $e->getMessage() . ' (' . get_class($e) . ') at '
625
-				. $e->getFile() . ' line ' . $e->getLine()
624
+				'Exception while generateDocument: '.$e->getMessage().' ('.get_class($e).') at '
625
+				. $e->getFile().' line '.$e->getLine()
626 626
 			);
627 627
 		}
628 628
 	}
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		$part = [];
830 830
 		foreach ($comments as $comment) {
831
-			$part[] = '<' . $comment->getActorId() . '> ' . $comment->getMessage();
831
+			$part[] = '<'.$comment->getActorId().'> '.$comment->getMessage();
832 832
 		}
833 833
 
834 834
 		$document->addPart('comments', implode(" \n ", $part));
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 
866 866
 			} catch (Throwable $e) {
867 867
 				$this->miscService->log(
868
-					'Issue while getting information on documentId:' . $document->getId(), 0
868
+					'Issue while getting information on documentId:'.$document->getId(), 0
869 869
 				);
870 870
 			}
871 871
 		}
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 		}
919 919
 
920 920
 		// 20220219 Parse .drawio file
921
-		if ($extension  === 'drawio') {
921
+		if ($extension === 'drawio') {
922 922
 			$parsed = self::MIMETYPE_TEXT;
923 923
 			throw new KnownFileMimeTypeException();
924 924
 		}
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
 		}
1038 1038
 
1039 1039
 		// 20220219 Inflate drawio file
1040
-		if ( $file->getExtension() === 'drawio') {
1040
+		if ($file->getExtension() === 'drawio') {
1041 1041
 			$content = $file->getContent();
1042 1042
 
1043 1043
 			try {
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 				    // Construct XML
1059 1059
 				    $diagram_xml = simplexml_load_string($diagram_str);
1060
-				    $content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml);
1060
+				    $content = $content.' '.$this->readDrawioXmlValue($diagram_xml);
1061 1061
 				}
1062 1062
 
1063 1063
 			} catch (\Throwable $t) {
@@ -1089,16 +1089,16 @@  discard block
 block discarded – undo
1089 1089
 	 */
1090 1090
 	private function readDrawioXmlValue(\SimpleXMLElement $element) {
1091 1091
 		$str = '';
1092
-		if( $element['value'] != null && trim(strval($element['value'])) !== '') {
1093
-			$str = $str . " " .  trim(strval($element['value']));
1092
+		if ($element['value'] != null && trim(strval($element['value'])) !== '') {
1093
+			$str = $str." ".trim(strval($element['value']));
1094 1094
 		}
1095
-		if( $element != null && trim(strval($element)) !== '') {
1096
-			$str = $str . " " . trim(strval($element));
1095
+		if ($element != null && trim(strval($element)) !== '') {
1096
+			$str = $str." ".trim(strval($element));
1097 1097
 		}
1098 1098
 
1099 1099
 		try {
1100 1100
 			foreach ($element->children() as $child) {
1101
-				$str = $str . " " . $this->readDrawioXmlValue($child);
1101
+				$str = $str." ".$this->readDrawioXmlValue($child);
1102 1102
 			}
1103 1103
 		} finally {
1104 1104
 		}
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 			$path = '';
1384 1384
 		}
1385 1385
 
1386
-		$result = (($entrySlash) ? '/' : '') . $path;
1386
+		$result = (($entrySlash) ? '/' : '').$path;
1387 1387
 		$this->debug(
1388 1388
 			'getPathFromRoot', [
1389 1389
 								 'path' => $path,
Please login to merge, or discard this patch.