Completed
Push — master ( 0dca94...0596a5 )
by Maxence
13s queued 12s
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
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 									  ->get($indexOptions->getOption('path', '/'));
232 232
 		} catch (Throwable $e) {
233 233
 			$this->e($e, ['userId' => $userId, 'options' => $indexOptions]);
234
-			\OC::$server->getLogger()->log(2, 'Issue while retrieving rootFolder for ' . $userId);
234
+			\OC::$server->getLogger()->log(2, 'Issue while retrieving rootFolder for '.$userId);
235 235
 
236 236
 			return [];
237 237
 		}
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		$tagIds = $this->systemTagObjectMapper->getTagIdsForObjects([$file->getId()], 'files');
482 482
 		if (array_key_exists($file->getId(), $tagIds)) {
483 483
 			$tags = array_values(
484
-				array_map(function (ISystemTag $tag): string {
484
+				array_map(function(ISystemTag $tag): string {
485 485
 					return $tag->getName();
486 486
 				}, $this->systemTagManager->getTagsByIds($tagIds[$file->getId()]))
487 487
 			);
@@ -615,8 +615,8 @@  discard block
 block discarded – undo
615 615
 			$document->getIndex()
616 616
 					 ->setStatus(IIndex::INDEX_IGNORE);
617 617
 			$this->miscService->log(
618
-				'Exception while generateDocument: ' . $e->getMessage() . ' (' . get_class($e) . ') at '
619
-				. $e->getFile() . ' line ' . $e->getLine()
618
+				'Exception while generateDocument: '.$e->getMessage().' ('.get_class($e).') at '
619
+				. $e->getFile().' line '.$e->getLine()
620 620
 			);
621 621
 		}
622 622
 	}
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 
820 820
 		$part = [];
821 821
 		foreach ($comments as $comment) {
822
-			$part[] = '<' . $comment->getActorId() . '> ' . $comment->getMessage();
822
+			$part[] = '<'.$comment->getActorId().'> '.$comment->getMessage();
823 823
 		}
824 824
 
825 825
 		$document->addPart('comments', implode(" \n ", $part));
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 					(!is_string($path)) ? $path = '' : $path;
855 855
 			} catch (Throwable $e) {
856 856
 				$this->miscService->log(
857
-					'Issue while getting information on documentId:' . $document->getId(), 0
857
+					'Issue while getting information on documentId:'.$document->getId(), 0
858 858
 				);
859 859
 			}
860 860
 		}
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		}
906 906
 
907 907
 		// 20220219 Parse .drawio file
908
-		if ($extension  === 'drawio') {
908
+		if ($extension === 'drawio') {
909 909
 			$parsed = self::MIMETYPE_TEXT;
910 910
 			throw new KnownFileMimeTypeException();
911 911
 		}
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 		}
1023 1023
 
1024 1024
 		// 20220219 Inflate drawio file
1025
-		if ( $file->getExtension() === 'drawio') {
1025
+		if ($file->getExtension() === 'drawio') {
1026 1026
 			$content = $file->getContent();
1027 1027
 
1028 1028
 			try {
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
 				    // Construct XML
1044 1044
 				    $diagram_xml = simplexml_load_string($diagram_str);
1045
-				    $content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml);
1045
+				    $content = $content.' '.$this->readDrawioXmlValue($diagram_xml);
1046 1046
 				}
1047 1047
 
1048 1048
 			} catch (\Throwable $t) {
@@ -1074,16 +1074,16 @@  discard block
 block discarded – undo
1074 1074
 	 */
1075 1075
 	private function readDrawioXmlValue(\SimpleXMLElement $element) {
1076 1076
 		$str = '';
1077
-		if( $element['value'] != null && trim(strval($element['value'])) !== '') {
1078
-			$str = $str . " " .  trim(strval($element['value']));
1077
+		if ($element['value'] != null && trim(strval($element['value'])) !== '') {
1078
+			$str = $str." ".trim(strval($element['value']));
1079 1079
 		}
1080
-		if( $element != null && trim(strval($element)) !== '') {
1081
-			$str = $str . " " . trim(strval($element));
1080
+		if ($element != null && trim(strval($element)) !== '') {
1081
+			$str = $str." ".trim(strval($element));
1082 1082
 		}
1083 1083
 
1084 1084
 		try {
1085 1085
 			foreach ($element->children() as $child) {
1086
-				$str = $str . " " . $this->readDrawioXmlValue($child);
1086
+				$str = $str." ".$this->readDrawioXmlValue($child);
1087 1087
 			}
1088 1088
 		} finally {
1089 1089
 		}
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
 			$path = '';
1368 1368
 		}
1369 1369
 
1370
-		$result = (($entrySlash) ? '/' : '') . $path;
1370
+		$result = (($entrySlash) ? '/' : '').$path;
1371 1371
 		$this->debug(
1372 1372
 			'getPathFromRoot', [
1373 1373
 				'path' => $path,
Please login to merge, or discard this patch.