Completed
Pull Request — master (#347)
by
unknown
17s
created
lib/Service/GroupFoldersService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			$this->getMountPoint($file);
80 80
 		} catch (FileIsNotIndexableException $e) {
81 81
 			return;
82
-		} catch (\OCP\Files\StorageNotAvailableException|\OCP\Files\NotFoundException $e) {
82
+		} catch (\OCP\Files\StorageNotAvailableException | \OCP\Files\NotFoundException $e) {
83 83
 			$path = '';
84 84
 			try {
85 85
 				$path = $file->getPath();
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			$mount = $this->getMountPoint($file);
108 108
 		} catch (FileIsNotIndexableException $e) {
109 109
 			return;
110
-		} catch (\OCP\Files\StorageNotAvailableException|\OCP\Files\NotFoundException $e) {
110
+		} catch (\OCP\Files\StorageNotAvailableException | \OCP\Files\NotFoundException $e) {
111 111
 			$path = '';
112 112
 			try {
113 113
 				$path = $file->getPath();
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			$mountPoint = new MountPoint();
176 176
 			$mount = $mount->toArray();
177 177
 			$mountPoint->setId($this->getInt('id', $mount, -1))
178
-				->setPath('/' . $userId . '/files/' . $mount['mount_point'])
178
+				->setPath('/'.$userId.'/files/'.$mount['mount_point'])
179 179
 				->setGroups(array_keys($mount['groups']));
180 180
 			$mountPoints[] = $mountPoint;
181 181
 		}
Please login to merge, or discard this patch.
lib/Service/ExternalFilesService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			$this->getMountPoint($file);
69 69
 		} catch (FileIsNotIndexableException $e) {
70 70
 			return;
71
-		} catch (StorageNotAvailableException|NotFoundException $e) {
71
+		} catch (StorageNotAvailableException | NotFoundException $e) {
72 72
 			$path = '';
73 73
 			try {
74 74
 				$path = $file->getPath();
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			$mount = $this->getMountPoint($file);
113 113
 		} catch (FileIsNotIndexableException $e) {
114 114
 			return;
115
-		} catch (StorageNotAvailableException|NotFoundException $e) {
115
+		} catch (StorageNotAvailableException | NotFoundException $e) {
116 116
 			$path = '';
117 117
 			try {
118 118
 				$path = $file->getPath();
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			);
187 187
 		} catch (ExternalMountNotFoundException $e) {
188 188
 			throw new FileIsNotIndexableException('issue while getMountPoint');
189
-		} catch (NotFoundException|StorageNotAvailableException $e) {
189
+		} catch (NotFoundException | StorageNotAvailableException $e) {
190 190
 			throw new FileIsNotIndexableException('storage not available');
191 191
 		}
192 192
 	}
Please login to merge, or discard this patch.
lib/Service/LocalFilesService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	public function getFileSource(Node $file, string &$source) {
52 52
 		try {
53 53
 			$mountType = $file->getMountPoint()->getMountType();
54
-		} catch (NotFoundException|StorageNotAvailableException $e) {
54
+		} catch (NotFoundException | StorageNotAvailableException $e) {
55 55
 			$this->logger->warning('Local mount not available when getting file source', ['exception' => $e]);
56 56
 			return;
57 57
 		}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
 		foreach ($shares['users'] ?? [] as $user => $node) {
113 113
 			if (!is_string($user)) {
114
-				$this->logger->warning('malformed access list: ' . json_encode($shares));
114
+				$this->logger->warning('malformed access list: '.json_encode($shares));
115 115
 				continue;
116 116
 			}
117 117
 			if (in_array($user, $users) || $this->userManager->get($user) === null) {
Please login to merge, or discard this patch.
lib/Service/FilesService.php 1 patch
Spacing   +20 added lines, -20 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)
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 				&& ($file->getMountPoint()->getMountType() === 'external')) {
543 543
 				throw new Exception();
544 544
 			}
545
-		} catch (FilesNotFoundException|NotFoundException $e) {
545
+		} catch (FilesNotFoundException | NotFoundException $e) {
546 546
 			// file removed -> remove from index
547 547
 			$index->setStatus(IIndex::INDEX_REMOVE);
548 548
 			$document = new FilesDocument($index->getProviderId(), $index->getDocumentId());
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 
745 745
 		$part = [];
746 746
 		foreach ($comments as $comment) {
747
-			$part[] = '<' . $comment->getActorId() . '> ' . $comment->getMessage();
747
+			$part[] = '<'.$comment->getActorId().'> '.$comment->getMessage();
748 748
 		}
749 749
 
750 750
 		$document->addPart('comments', implode(" \n ", $part));
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 				$shareNames[$this->secureUsername($username)]
779 779
 					= (!is_string($path)) ? $path = '' : $path;
780 780
 			} catch (Throwable $e) {
781
-				$this->logger->debug('Issue while getting information on documentId:' . $document->getId(), ['exception' => $e]);
781
+				$this->logger->debug('Issue while getting information on documentId:'.$document->getId(), ['exception' => $e]);
782 782
 			}
783 783
 		}
784 784
 
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 			$document->setContent(
954 954
 				base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
955 955
 			);
956
-		} catch (NotPermittedException|LockedException $e) {
956
+		} catch (NotPermittedException | LockedException $e) {
957 957
 		}
958 958
 	}
959 959
 
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 
1001 1001
 					// Construct XML
1002 1002
 					$diagram_xml = simplexml_load_string($diagram_str);
1003
-					$content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml);
1003
+					$content = $content.' '.$this->readDrawioXmlValue($diagram_xml);
1004 1004
 				}
1005 1005
 			} catch (\Throwable $t) {
1006 1006
 			}
@@ -1010,14 +1010,14 @@  discard block
 block discarded – undo
1010 1010
 					// 20220219 Pass content of inflated drawio graph xml
1011 1011
 					base64_encode($content), IIndexDocument::ENCODED_BASE64
1012 1012
 				);
1013
-			} catch (NotPermittedException|LockedException $e) {
1013
+			} catch (NotPermittedException | LockedException $e) {
1014 1014
 			}
1015 1015
 		} else {
1016 1016
 			try {
1017 1017
 				$document->setContent(
1018 1018
 					base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
1019 1019
 				);
1020
-			} catch (NotPermittedException|LockedException $e) {
1020
+			} catch (NotPermittedException | LockedException $e) {
1021 1021
 			}
1022 1022
 		}
1023 1023
 	}
@@ -1032,15 +1032,15 @@  discard block
 block discarded – undo
1032 1032
 	private function readDrawioXmlValue(\SimpleXMLElement $element) {
1033 1033
 		$str = '';
1034 1034
 		if ($element['value'] !== null && trim(strval($element['value'])) !== '') {
1035
-			$str = $str . ' ' . trim(strval($element['value']));
1035
+			$str = $str.' '.trim(strval($element['value']));
1036 1036
 		}
1037 1037
 		if ($element !== null && trim(strval($element)) !== '') {
1038
-			$str = $str . ' ' . trim(strval($element));
1038
+			$str = $str.' '.trim(strval($element));
1039 1039
 		}
1040 1040
 
1041 1041
 		try {
1042 1042
 			foreach ($element->children() as $child) {
1043
-				$str = $str . ' ' . $this->readDrawioXmlValue($child);
1043
+				$str = $str.' '.$this->readDrawioXmlValue($child);
1044 1044
 			}
1045 1045
 		} finally {
1046 1046
 		}
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 			$document->setContent(
1077 1077
 				base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
1078 1078
 			);
1079
-		} catch (NotPermittedException|LockedException $e) {
1079
+		} catch (NotPermittedException | LockedException $e) {
1080 1080
 		}
1081 1081
 	}
1082 1082
 
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 			$document->setContent(
1113 1113
 				base64_encode($file->getContent()), IIndexDocument::ENCODED_BASE64
1114 1114
 			);
1115
-		} catch (NotPermittedException|LockedException $e) {
1115
+		} catch (NotPermittedException | LockedException $e) {
1116 1116
 		}
1117 1117
 	}
1118 1118
 
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 			$path = '';
1294 1294
 		}
1295 1295
 
1296
-		$result = (($entrySlash) ? '/' : '') . $path;
1296
+		$result = (($entrySlash) ? '/' : '').$path;
1297 1297
 		$this->logger->debug(
1298 1298
 			'getPathFromRoot', [
1299 1299
 				'path' => $path,
Please login to merge, or discard this patch.