Completed
Pull Request — master (#347)
by
unknown
16s
created
lib/Service/FilesService.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		} catch (NotFoundException $e) {
117 117
 			return [];
118 118
 		} catch (Throwable $e) {
119
-			$this->logger->warning('Issue while retrieving rootFolder for ' . $userId, ['exception' => $e]);
119
+			$this->logger->warning('Issue while retrieving rootFolder for '.$userId, ['exception' => $e]);
120 120
 			return [];
121 121
 		}
122 122
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 				$result[] = $this->generateFilesDocumentFromFile($userId, $files);
207 207
 			} catch (FileIsNotIndexableException $e) {
208 208
 				// file is not indexable - skip
209
-			} catch (NotFoundException|StorageNotAvailableException $e) {
209
+			} catch (NotFoundException | StorageNotAvailableException $e) {
210 210
 				$this->logger->warning('File not available when getting files from user, skipping', ['path' => $files->getPath(), 'exception' => $e]);
211 211
 			} catch (Throwable $e) {
212 212
 				$this->logger->warning('Unexpected error while getting files from user, skipping', ['path' => $files->getPath(), 'exception' => $e]);
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 			} catch (FileIsNotIndexableException $e) {
261 261
 				// file is not indexable - skip
262 262
 				continue;
263
-			} catch (NotFoundException|StorageNotAvailableException $e) {
263
+			} catch (NotFoundException | StorageNotAvailableException $e) {
264 264
 				// file not found or storage temporarily not available - skip and continue
265 265
 				$this->logger->warning('File not available while listing directory, skipping', ['path' => $file->getPath(), 'exception' => $e]);
266 266
 				continue;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		$tagIds = $this->systemTagObjectMapper->getTagIdsForObjects([$file->getId()], 'files');
378 378
 		if (array_key_exists($file->getId(), $tagIds)) {
379 379
 			$tags = array_values(
380
-				array_map(function (ISystemTag $tag): string {
380
+				array_map(function(ISystemTag $tag): string {
381 381
 					return $tag->getName();
382 382
 				}, $this->systemTagManager->getTagsByIds($tagIds[$file->getId()]))
383 383
 			);
@@ -395,10 +395,10 @@  discard block
 block discarded – undo
395 395
 				]
396 396
 			);
397 397
 		} else {
398
-			$this->logger->warning('stat() on File #' . $file->getId() . ' is not an array: ' . json_encode($stat));
398
+			$this->logger->warning('stat() on File #'.$file->getId().' is not an array: '.json_encode($stat));
399 399
 		}
400 400
 
401
-		} catch (NotFoundException|StorageNotAvailableException|NotPermittedException|LockedException $e) {
401
+		} catch (NotFoundException | StorageNotAvailableException | NotPermittedException | LockedException $e) {
402 402
 			// storage not available or file removed / access issue - mark as not indexable
403 403
 			throw new FileIsNotIndexableException($e->getMessage());
404 404
 		}
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 		}
457 457
 
458 458
 		if ($this->userManager->get($userId) === null) {
459
-			throw new NoUserException('User does not exist: ' . $userId);
459
+			throw new NoUserException('User does not exist: '.$userId);
460 460
 		}
461 461
 
462 462
 		$files = $this->rootFolder->getUserFolder($userId)
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 
724 724
 		$part = [];
725 725
 		foreach ($comments as $comment) {
726
-			$part[] = '<' . $comment->getActorId() . '> ' . $comment->getMessage();
726
+			$part[] = '<'.$comment->getActorId().'> '.$comment->getMessage();
727 727
 		}
728 728
 
729 729
 		$document->addPart('comments', implode(" \n ", $part));
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 				$shareNames[$this->secureUsername($username)]
758 758
 					= (!is_string($path)) ? $path = '' : $path;
759 759
 			} catch (Throwable $e) {
760
-				$this->logger->debug('Issue while getting information on documentId:' . $document->getId(), ['exception' => $e]);
760
+				$this->logger->debug('Issue while getting information on documentId:'.$document->getId(), ['exception' => $e]);
761 761
 			}
762 762
 		}
763 763
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 			$document->setContent(
933 933
 				base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
934 934
 			);
935
-		} catch (NotPermittedException|LockedException $e) {
935
+		} catch (NotPermittedException | LockedException $e) {
936 936
 		}
937 937
 	}
938 938
 
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 
980 980
 					// Construct XML
981 981
 					$diagram_xml = simplexml_load_string($diagram_str);
982
-					$content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml);
982
+					$content = $content.' '.$this->readDrawioXmlValue($diagram_xml);
983 983
 				}
984 984
 			} catch (\Throwable $t) {
985 985
 			}
@@ -989,14 +989,14 @@  discard block
 block discarded – undo
989 989
 					// 20220219 Pass content of inflated drawio graph xml
990 990
 					base64_encode($content), IIndexDocument::ENCODED_BASE64
991 991
 				);
992
-			} catch (NotPermittedException|LockedException $e) {
992
+			} catch (NotPermittedException | LockedException $e) {
993 993
 			}
994 994
 		} else {
995 995
 			try {
996 996
 				$document->setContent(
997 997
 					base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
998 998
 				);
999
-			} catch (NotPermittedException|LockedException $e) {
999
+			} catch (NotPermittedException | LockedException $e) {
1000 1000
 			}
1001 1001
 		}
1002 1002
 	}
@@ -1011,15 +1011,15 @@  discard block
 block discarded – undo
1011 1011
 	private function readDrawioXmlValue(\SimpleXMLElement $element) {
1012 1012
 		$str = '';
1013 1013
 		if ($element['value'] !== null && trim(strval($element['value'])) !== '') {
1014
-			$str = $str . ' ' . trim(strval($element['value']));
1014
+			$str = $str.' '.trim(strval($element['value']));
1015 1015
 		}
1016 1016
 		if ($element !== null && trim(strval($element)) !== '') {
1017
-			$str = $str . ' ' . trim(strval($element));
1017
+			$str = $str.' '.trim(strval($element));
1018 1018
 		}
1019 1019
 
1020 1020
 		try {
1021 1021
 			foreach ($element->children() as $child) {
1022
-				$str = $str . ' ' . $this->readDrawioXmlValue($child);
1022
+				$str = $str.' '.$this->readDrawioXmlValue($child);
1023 1023
 			}
1024 1024
 		} finally {
1025 1025
 		}
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 			$document->setContent(
1056 1056
 				base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
1057 1057
 			);
1058
-		} catch (NotPermittedException|LockedException $e) {
1058
+		} catch (NotPermittedException | LockedException $e) {
1059 1059
 		}
1060 1060
 	}
1061 1061
 
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
 			$document->setContent(
1092 1092
 				base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
1093 1093
 			);
1094
-		} catch (NotPermittedException|LockedException $e) {
1094
+		} catch (NotPermittedException | LockedException $e) {
1095 1095
 		}
1096 1096
 	}
1097 1097
 
@@ -1272,7 +1272,7 @@  discard block
 block discarded – undo
1272 1272
 			$path = '';
1273 1273
 		}
1274 1274
 
1275
-		$result = (($entrySlash) ? '/' : '') . $path;
1275
+		$result = (($entrySlash) ? '/' : '').$path;
1276 1276
 		$this->logger->debug(
1277 1277
 			'getPathFromRoot', [
1278 1278
 				'path' => $path,
Please login to merge, or discard this patch.