Completed
Pull Request — master (#2254)
by Konstantin
31s
created
lib/FileSharingTeamResourceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,18 +72,18 @@  discard block
 block discarded – undo
72 72
 	 * @return TeamResource[]
73 73
 	 */
74 74
 	private function convertWrappedShareToResource(array $shares): array {
75
-		usort($shares, function ($a, $b) {
75
+		usort($shares, function($a, $b) {
76 76
 			return (int)($b->getItemType() === 'folder') - (int)($a->getItemType() === 'folder');
77 77
 		});
78
-		return array_map(function (ShareWrapper $shareWrapper) {
78
+		return array_map(function(ShareWrapper $shareWrapper) {
79 79
 			$isFolder = $shareWrapper->getItemType() === 'folder';
80 80
 			return new TeamResource(
81 81
 				$this,
82 82
 				(string)$shareWrapper->getFileSource(),
83 83
 				basename($shareWrapper->getFileTarget()),
84
-				$this->urlGenerator->getAbsoluteURL('/index.php/f/' . $shareWrapper->getFileSource()),
84
+				$this->urlGenerator->getAbsoluteURL('/index.php/f/'.$shareWrapper->getFileSource()),
85 85
 				iconSvg: $isFolder ? '<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder" viewBox="0 0 24 24"><path d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z" /></svg>' : null,
86
-				iconURL: !$isFolder ?
86
+				iconURL : !$isFolder ?
87 87
 					$this->urlGenerator->linkToRouteAbsolute('core.preview.getPreviewByFileId', ['fileId' => $shareWrapper->getFileSource(), 'mimeFallback' => true, ])
88 88
 					: null,
89 89
 			);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			return false;
96 96
 		}
97 97
 
98
-		return count(array_filter($this->getSharedWith($teamId), function (TeamResource $resource) use ($resourceId) {
98
+		return count(array_filter($this->getSharedWith($teamId), function(TeamResource $resource) use ($resourceId) {
99 99
 			return $resource->getId() === $resourceId;
100 100
 		})) !== 0;
101 101
 	}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 		$shares = $this->shareByCircleProvider->getSharesByFileId((int)$resourceId);
109 109
 
110
-		return array_map(function ($share) {
110
+		return array_map(function($share) {
111 111
 			return $share->getSharedWith();
112 112
 		}, $shares);
113 113
 	}
Please login to merge, or discard this patch.
lib/Db/FileSharesRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 		$expr = $qb->expr();
84 84
 
85 85
 		$this->limitToShareType($qb, self::SHARE_TYPE);
86
-		$qb->andWhere($expr->isNull($this->default_select_alias . '.parent'));
86
+		$qb->andWhere($expr->isNull($this->default_select_alias.'.parent'));
87 87
 
88 88
 		$shares = [];
89 89
 		$cursor = $qb->executeQuery();
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
 	 * @throws Throwable
134 134
 	 */
135 135
 	public function boot(IBootContext $context): void {
136
-		$context->injectFn(function (IShareManager $shareManager) {
136
+		$context->injectFn(function(IShareManager $shareManager) {
137 137
 			$shareManager->registerShareProvider(ShareByCircleProvider::class);
138 138
 		});
139 139
 
Please login to merge, or discard this patch.
lib/Circles/FileSharingBroadcaster.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 			$this->configService = Server::get(ConfigService::class);
116 116
 			$this->miscService = Server::get(MiscService::class);
117 117
 		} catch (ContainerExceptionInterface $e) {
118
-			$this->logger->info('Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage(), ['exception' => $e]);
118
+			$this->logger->info('Circles: cannot init FileSharingBroadcaster - '.$e->getMessage(), ['exception' => $e]);
119 119
 		}
120 120
 
121 121
 		try {
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
 		$allShares = $this->fileSharesRequest->getSharesForCircle($member->getCircleId());
262 262
 		$knownShares = array_map(
263
-			function (SharesToken $shareToken) {
263
+			function(SharesToken $shareToken) {
264 264
 				return $shareToken->getShareId();
265 265
 			},
266 266
 			$this->tokensRequest->getTokensFromMember($member)
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @throws IllegalIDChangeException
308 308
 	 */
309 309
 	private function generateShare($data): IShare {
310
-		$this->logger->log(0, 'Regenerate shares from payload: ' . json_encode($data));
310
+		$this->logger->log(0, 'Regenerate shares from payload: '.json_encode($data));
311 311
 
312 312
 		$share = new Share($this->rootFolder, $this->userManager);
313 313
 		$share->setId($data['id']);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 			);
400 400
 			$this->sendPasswordByMail($share, $displayName, $email, $password);
401 401
 		} catch (Exception $e) {
402
-			$this->logger->info('Circles::sharedByMail - mail were not sent: ' . $e->getMessage(), ['exception' => $e]);
402
+			$this->logger->info('Circles::sharedByMail - mail were not sent: '.$e->getMessage(), ['exception' => $e]);
403 403
 		}
404 404
 	}
405 405
 
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
 		$message = $this->mailer->createMessage();
418 418
 
419 419
 		$this->logger->log(
420
-			0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName
421
-			   . ' - link: ' . $link
420
+			0, "Sending mail to circle '".$circleName."': ".$email.' file: '.$fileName
421
+			   . ' - link: '.$link
422 422
 		);
423 423
 
424 424
 		$subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]);
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 
457 457
 		$message = $this->mailer->createMessage();
458 458
 
459
-		$this->logger->log(0, "Sending password mail to circle '" . $circleName . "': " . $email);
459
+		$this->logger->log(0, "Sending password mail to circle '".$circleName."': ".$email);
460 460
 
461 461
 		$filename = $share->getNode()
462 462
 			->getName();
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 		$message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]);
512 512
 		if ($initiatorEmailAddress !== null) {
513 513
 			$message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
514
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
514
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
515 515
 		} else {
516 516
 			$emailTemplate->addFooter();
517 517
 		}
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 		$emailTemplate->addHeader();
547 547
 		$emailTemplate->addHeading($subject, false);
548 548
 		$emailTemplate->addBodyText(
549
-			htmlspecialchars($text) . '<br>' . htmlspecialchars(
549
+			htmlspecialchars($text).'<br>'.htmlspecialchars(
550 550
 				$this->l10n->t('Click the button below to open it.')
551 551
 			), $text
552 552
 		);
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 			$this->sendMailExistingShares($template, $author->getCachedName(), $recipient);
593 593
 			$this->sendPasswordExistingShares($author, $recipient, $password);
594 594
 		} catch (Exception $e) {
595
-			$this->logger->log(2, 'Failed to send mail about existing share ' . $e->getMessage());
595
+			$this->logger->log(2, 'Failed to send mail about existing share '.$e->getMessage());
596 596
 		}
597 597
 	}
598 598
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 		$authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author;
616 616
 		$authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null;
617 617
 
618
-		$this->logger->log(0, "Sending password mail about existing files to '" . $email . "'");
618
+		$this->logger->log(0, "Sending password mail about existing files to '".$email."'");
619 619
 
620 620
 		$plainBodyPart = $this->l10n->t(
621 621
 			"%1\$s shared multiple files with you.\nYou should have already received a separate email with a link to access them.\n",
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 		$message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]);
658 658
 		if ($authorEmail !== null) {
659 659
 			$message->setReplyTo([$authorEmail => $authorName]);
660
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
660
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
661 661
 		} else {
662 662
 			$emailTemplate->addFooter();
663 663
 		}
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 	 */
703 703
 	protected function generateMailExitingShares($author, $circleName) {
704 704
 		$this->logger->log(
705
-			0, "Generating mail about existing share mail from '" . $author . "' in "
705
+			0, "Generating mail about existing share mail from '".$author."' in "
706 706
 			   . $circleName
707 707
 		);
708 708
 
Please login to merge, or discard this patch.
lib/Activity/Provider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 			$this->parseAsNonMember($event, $params);
49 49
 			$this->parseAsMember($event, $params);
50 50
 			$this->parseAsModerator($event, $params);
51
-		} catch (FakeException|InvalidItemException) {
51
+		} catch (FakeException | InvalidItemException) {
52 52
 			/** clean exit */
53 53
 		}
54 54
 
Please login to merge, or discard this patch.
lib/Activity/Deprecated/ProviderParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 				continue;
126 126
 			}
127 127
 
128
-			$replace['{' . $k . '}'] = $data[$k]['_parsed'];
128
+			$replace['{'.$k.'}'] = $data[$k]['_parsed'];
129 129
 		}
130 130
 
131 131
 		$event->setParsedSubject(strtr($line, $replace));
Please login to merge, or discard this patch.
lib/Activity/Deprecated/Provider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 			$this->parseAsNonMember($event, $circle);
69 69
 			$this->parseAsMember($event, $circle, $params);
70 70
 			$this->parseAsModerator($event, $circle, $params);
71
-		} catch (FakeException|InvalidItemException $e) {
71
+		} catch (FakeException | InvalidItemException $e) {
72 72
 			/** clean exit */
73 73
 		}
74 74
 
Please login to merge, or discard this patch.
lib/Service/ActivityService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 		);
52 52
 
53 53
 		$this->userManager->callForSeenUsers(
54
-			function ($user) use ($event) {
54
+			function($user) use ($event) {
55 55
 				/** @var IUser $user */
56 56
 				$this->publishEvent($event, [$user]);
57 57
 			}
Please login to merge, or discard this patch.
lib/Command/MigrateCustomGroups.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
 
79 79
 			$name = $rowCG['display_name'];
80 80
 			while (strlen($name) < 3) {
81
-				$name = '_' . $name;
81
+				$name = '_'.$name;
82 82
 			}
83 83
 
84
-			$this->output->writeln('+ New Team <info>' . $name . '</info>, owned by <info>' . $ownerId . '</info>');
84
+			$this->output->writeln('+ New Team <info>'.$name.'</info>, owned by <info>'.$ownerId.'</info>');
85 85
 
86 86
 			// based on owner's userid, we create federateduser and a new circle
87 87
 			$owner = $this->cachedFed($ownerId);
88 88
 			if ($owner === null) {
89
-				$this->output->writeln('<error>unknown user</error> ' . $ownerId);
89
+				$this->output->writeln('<error>unknown user</error> '.$ownerId);
90 90
 				continue;
91 91
 			}
92 92
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			try {
96 96
 				$circle = $this->circlesManager->createCircle($name);
97 97
 			} catch (\Exception $e) {
98
-				$this->output->writeln('<error>' . get_class($e) . ' ' . $e->getMessage() . '</error> with data ' . json_encode($rowCG));
98
+				$this->output->writeln('<error>'.get_class($e).' '.$e->getMessage().'</error> with data '.json_encode($rowCG));
99 99
 				$this->logger->log(2, 'error while creating team', ['exception' => $e]);
100 100
 				$this->circlesManager->stopSession();
101 101
 				continue;
@@ -124,17 +124,17 @@  discard block
 block discarded – undo
124 124
 
125 125
 					$fedUser = $this->cachedFed($userId);
126 126
 					if ($fedUser === null) {
127
-						$this->output->writeln('<error>unknown user</error> ' . $userId);
127
+						$this->output->writeln('<error>unknown user</error> '.$userId);
128 128
 						continue;
129 129
 					}
130
-					$this->output->writeln(' - new member <info>' . $userId . '</info>');
130
+					$this->output->writeln(' - new member <info>'.$userId.'</info>');
131 131
 
132 132
 					$member = $this->circlesManager->addMember($circle->getSingleId(), $fedUser);
133 133
 					if ($rowM['role'] === '1') {
134 134
 						$this->circlesManager->levelMember($member->getId(), Member::LEVEL_ADMIN);
135 135
 					}
136 136
 				} catch (\Exception $e) {
137
-					$this->output->writeln('<error>' . get_class($e) . ' ' . $e->getMessage() . '</error>');
137
+					$this->output->writeln('<error>'.get_class($e).' '.$e->getMessage().'</error>');
138 138
 					$this->logger->log(2, 'error while migrating custom group member', ['exception' => $e]);
139 139
 				}
140 140
 			}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			->where($update->expr()->in('id', $update->createNamedParameter($shareIds, IQueryBuilder::PARAM_INT_ARRAY)));
171 171
 
172 172
 		$count = $update->executeStatement();
173
-		$this->output->writeln('> ' . ((string)$count) . ' shares updated');
173
+		$this->output->writeln('> '.((string)$count).' shares updated');
174 174
 
175 175
 		$this->fixShareChildren($shareIds, $memberIds);
176 176
 	}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			try {
187 187
 				$this->fedList[$userId] = $this->circlesManager->getLocalFederatedUser($userId);
188 188
 			} catch (\Exception $e) {
189
-				$this->logger->warning('unknown local user ' . $userId, ['exception' => $e]);
189
+				$this->logger->warning('unknown local user '.$userId, ['exception' => $e]);
190 190
 				$this->fedList[$userId] = null;
191 191
 			}
192 192
 		}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			$count += $update->executeStatement();
221 221
 		}
222 222
 
223
-		$this->output->writeln('> ' . ((string)$count) . ' children shares updated');
223
+		$this->output->writeln('> '.((string)$count).' children shares updated');
224 224
 	}
225 225
 
226 226
 
Please login to merge, or discard this patch.