Completed
Pull Request — master (#384)
by Tortue
02:27
created
lib/Db/CircleProviderRequestBuilder.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : '';
77 77
 		$qb->andWhere(
78 78
 			$expr->in(
79
-				$pf . 'share_with',
79
+				$pf.'share_with',
80 80
 				$qb->createNamedParameter($circleUniqueIds, IQueryBuilder::PARAM_STR_ARRAY)
81 81
 			)
82 82
 		);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		$expr = $qb->expr();
94 94
 		$pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : '';
95 95
 
96
-		$qb->andWhere($expr->eq($pf . 'id', $qb->createNamedParameter($shareId)));
96
+		$qb->andWhere($expr->eq($pf.'id', $qb->createNamedParameter($shareId)));
97 97
 	}
98 98
 
99 99
 
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 		/** @noinspection PhpMethodParametersCountMismatchInspection */
143 143
 		$qb->andWhere(
144 144
 			$expr->orX(
145
-				$expr->eq($pf . 'parent', $qb->createNamedParameter($circleId)),
146
-				$expr->eq($pf . 'id', $qb->createNamedParameter($circleId))
145
+				$expr->eq($pf.'parent', $qb->createNamedParameter($circleId)),
146
+				$expr->eq($pf.'id', $qb->createNamedParameter($circleId))
147 147
 			)
148 148
 		);
149 149
 	}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : '';
166 166
 		$qb->andWhere(
167 167
 			$expr->in(
168
-				$pf . 'file_source',
168
+				$pf.'file_source',
169 169
 				$qb->createNamedParameter($files, IQueryBuilder::PARAM_INT_ARRAY)
170 170
 			)
171 171
 		);
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
 		$pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : '';
199 199
 
200 200
 		if ($reShares === false) {
201
-			$qb->andWhere($expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId)));
201
+			$qb->andWhere($expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId)));
202 202
 		} else {
203 203
 			/** @noinspection PhpMethodParametersCountMismatchInspection */
204 204
 			$qb->andWhere(
205 205
 				$expr->orX(
206
-					$expr->eq($pf . 'uid_owner', $qb->createNamedParameter($userId)),
207
-					$expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId))
206
+					$expr->eq($pf.'uid_owner', $qb->createNamedParameter($userId)),
207
+					$expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId))
208 208
 				)
209 209
 			);
210 210
 		}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 		$tmpOrX = $expr->eq(
228 228
 			's.share_with',
229
-			$qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')')
229
+			$qb->createFunction('SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')')
230 230
 		);
231 231
 
232 232
 		if ($shareId === -1) {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			'c', CoreRequestBuilder::TABLE_MEMBERS, 'mo', $expr->andX(
258 258
 			$expr->eq(
259 259
 				'mo.circle_id',
260
-        $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')')
260
+        $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')')
261 261
 			), $expr->eq('mo.user_type', $qb->createNamedParameter(Member::TYPE_USER)),
262 262
 			$expr->eq('mo.level', $qb->createNamedParameter(Member::LEVEL_OWNER))
263 263
 		)
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		return $qb->expr()->andX(
314 314
 			$expr->in(
315 315
 				$qb->createFunction(
316
-					'SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')'
316
+					'SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')'
317 317
 				),
318 318
 				$qb->createFunction($subQb->getSQL())
319 319
 			)
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 		return $qb->expr()->andX(
352 352
 			$expr->in(
353 353
 				$qb->createFunction(
354
-					'SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')'
354
+					'SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')'
355 355
 				),
356 356
 				$qb->createFunction($subQb->getSQL())
357 357
 			)
Please login to merge, or discard this patch.
appinfo/autoload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 
32 32
 namespace OCA\Circles\AppInfo;
33 33
 
34
-$composerDir = __DIR__ . '/../vendor/';
34
+$composerDir = __DIR__.'/../vendor/';
35 35
 
36
-if (is_dir($composerDir) && file_exists($composerDir . 'autoload.php')) {
37
-	require_once $composerDir . 'autoload.php';
36
+if (is_dir($composerDir) && file_exists($composerDir.'autoload.php')) {
37
+	require_once $composerDir.'autoload.php';
38 38
 }
39 39
 
Please login to merge, or discard this patch.
lib/Service/MembersService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@
 block discarded – undo
344 344
 			);
345 345
 		}
346 346
 
347
-		$tmpContact = $this->userId . ':' . $ident;
347
+		$tmpContact = $this->userId.':'.$ident;
348 348
 		$result = MiscService::getContactData($tmpContact);
349 349
 		if (empty($result)) {
350 350
 			throw new NoUserException($this->l10n->t("This contact is not available"));
Please login to merge, or discard this patch.
lib/ShareByCircleProvider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -300,19 +300,19 @@  discard block
 block discarded – undo
300 300
 	 */
301 301
 	private function createShare($share) {
302 302
 		$this->miscService->log(
303
-			'Creating share (1/4) - type: ' . $share->getShareType() . ' - token: '
304
-			. $share->getToken() . ' - type: ' . $share->getShareType() . ' - with: '
305
-			. $share->getSharedWith() . ' - permissions: ' . $share->getPermissions(), 0
303
+			'Creating share (1/4) - type: '.$share->getShareType().' - token: '
304
+			. $share->getToken().' - type: '.$share->getShareType().' - with: '
305
+			. $share->getSharedWith().' - permissions: '.$share->getPermissions(), 0
306 306
 		);
307 307
 
308 308
 		$qb = $this->getBaseInsertSql($share);
309
-		$this->miscService->log('Share creation (2/4) : ' . json_encode($qb->getSQL()), 0);
309
+		$this->miscService->log('Share creation (2/4) : '.json_encode($qb->getSQL()), 0);
310 310
 
311 311
 		$result = $qb->execute();
312
-		$this->miscService->log('Share creation result (3/4) : ' . json_encode($result), 0);
312
+		$this->miscService->log('Share creation result (3/4) : '.json_encode($result), 0);
313 313
 
314 314
 		$id = $qb->getLastInsertId();
315
-		$this->miscService->log('Share created ID (4/4) : ' . $id, 0);
315
+		$this->miscService->log('Share created ID (4/4) : '.$id, 0);
316 316
 
317 317
 		try {
318 318
 			$share->setId($id);
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 	public function getShareByToken($token) {
538 538
 		$qb = $this->dbConnection->getQueryBuilder();
539 539
 
540
-		$this->miscService->log("Opening share by token '#" . $token . "'", 0);
540
+		$this->miscService->log("Opening share by token '#".$token."'", 0);
541 541
 
542 542
 		$cursor = $qb->select('*')
543 543
 					 ->from('share')
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 			try {
562 562
 				$data = $this->getShareByPersonalToken($token);
563 563
 			} catch (Exception $e) {
564
-				$this->miscService->log("Share '#" . $token . "' not found.", 0);
564
+				$this->miscService->log("Share '#".$token."' not found.", 0);
565 565
 				throw new ShareNotFound('Share not found', $this->l10n->t('Could not find share'));
566 566
 			}
567 567
 		}
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 			$share = $this->createShareObject($data);
571 571
 		} catch (InvalidShare $e) {
572 572
 			$this->miscService->log(
573
-				"Share Object '#" . $token . "' not created. " . json_encode($data), 0
573
+				"Share Object '#".$token."' not created. ".json_encode($data), 0
574 574
 			);
575 575
 			throw new ShareNotFound('Share not found', $this->l10n->t('Could not find share'));
576 576
 		}
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 			);
933 933
 
934 934
 		$cursor = $qb->execute();
935
-		while($data = $cursor->fetch()) {
935
+		while ($data = $cursor->fetch()) {
936 936
 			$share = $this->createShareObject($data);
937 937
 
938 938
 			yield $share;
Please login to merge, or discard this patch.
appinfo/app.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 use OCA\Circles\AppInfo\Application;
31 31
 
32 32
 
33
-require_once __DIR__ . '/autoload.php';
33
+require_once __DIR__.'/autoload.php';
34 34
 
35 35
 
36 36
 $app = \OC::$server->query(Application::class);
Please login to merge, or discard this patch.
lib/Model/DavCard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 	 * @return string
147 147
 	 */
148 148
 	public function getUniqueId(): string {
149
-		return $this->getAddressBookId() . '/' . $this->getCardUri();
149
+		return $this->getAddressBookId().'/'.$this->getCardUri();
150 150
 	}
151 151
 
152 152
 
Please login to merge, or discard this patch.
lib/Circles/FileSharingBroadcaster.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			$this->miscService = OC::$server->query(MiscService::class);
146 146
 		} catch (QueryException $e) {
147 147
 			OC::$server->getLogger()
148
-					   ->log(1, 'Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage());
148
+					   ->log(1, 'Circles: cannot init FileSharingBroadcaster - '.$e->getMessage());
149 149
 		}
150 150
 
151 151
 		try {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	 * @throws IllegalIDChangeException
323 323
 	 */
324 324
 	private function generateShare($data): IShare {
325
-		$this->logger->log(0, 'Regenerate shares from payload: ' . json_encode($data));
325
+		$this->logger->log(0, 'Regenerate shares from payload: '.json_encode($data));
326 326
 
327 327
 		$share = new Share($this->rootFolder, $this->userManager);
328 328
 		$share->setId($data['id']);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			);
414 414
 		} catch (Exception $e) {
415 415
 			OC::$server->getLogger()
416
-					   ->log(1, 'Circles::sharedByMail - mail were not sent: ' . $e->getMessage());
416
+					   ->log(1, 'Circles::sharedByMail - mail were not sent: '.$e->getMessage());
417 417
 		}
418 418
 	}
419 419
 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 		$message = $this->mailer->createMessage();
432 432
 
433 433
 		$this->logger->log(
434
-			0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName
435
-			   . ' - link: ' . $link
434
+			0, "Sending mail to circle '".$circleName."': ".$email.' file: '.$fileName
435
+			   . ' - link: '.$link
436 436
 		);
437 437
 
438 438
 		$subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 
472 472
 		$message = $this->mailer->createMessage();
473 473
 
474
-		$this->logger->log(0, "Sending password mail to circle '" . $circleName . "': " . $email);
474
+		$this->logger->log(0, "Sending password mail to circle '".$circleName."': ".$email);
475 475
 
476 476
 		$filename = $share->getNode()
477 477
 						  ->getName();
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
527 527
 		if ($initiatorEmailAddress !== null) {
528 528
 			$message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
529
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
529
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
530 530
 		} else {
531 531
 			$emailTemplate->addFooter();
532 532
 		}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 		$emailTemplate->addHeader();
562 562
 		$emailTemplate->addHeading($subject, false);
563 563
 		$emailTemplate->addBodyText(
564
-			htmlspecialchars($text) . '<br>' . htmlspecialchars(
564
+			htmlspecialchars($text).'<br>'.htmlspecialchars(
565 565
 				$this->l10n->t('Click the button below to open it.')
566 566
 			), $text
567 567
 		);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			$this->sendMailExistingShares($template, $author, $recipient);
607 607
 			$this->sendPasswordExistingShares($author, $recipient, $password);
608 608
 		} catch (Exception $e) {
609
-			$this->logger->log(2, 'Failed to send mail about existing share ' . $e->getMessage());
609
+			$this->logger->log(2, 'Failed to send mail about existing share '.$e->getMessage());
610 610
 		}
611 611
 	}
612 612
 
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 		$authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author;
631 631
 		$authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null;
632 632
 
633
-		$this->logger->log(0, "Sending password mail about existing files to '" . $email . "'");
633
+		$this->logger->log(0, "Sending password mail about existing files to '".$email."'");
634 634
 
635 635
 		$plainBodyPart = $this->l10n->t(
636 636
 			"%1\$s shared multiple files with you.\nYou should have already received a separate mail with a link to access them.\n",
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
673 673
 		if ($authorEmail !== null) {
674 674
 			$message->setReplyTo([$authorEmail => $authorName]);
675
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
675
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
676 676
 		} else {
677 677
 			$emailTemplate->addFooter();
678 678
 		}
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 	 */
720 720
 	protected function generateMailExitingShares($author, $circleName) {
721 721
 		$this->logger->log(
722
-			0, "Generating mail about existing share mail from '" . $author . "' in "
722
+			0, "Generating mail about existing share mail from '".$author."' in "
723 723
 			   . $circleName
724 724
 		);
725 725
 
Please login to merge, or discard this patch.
lib/Service/DavService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	public function onDeleteCard(GenericEvent $event) {
159 159
 		$davCard = $this->generateDavCard($event, true);
160 160
 
161
-		$this->miscService->log('Deleting Card: ' . json_encode($davCard), 1);
161
+		$this->miscService->log('Deleting Card: '.json_encode($davCard), 1);
162 162
 		$this->membersRequest->removeMembersByContactId($davCard->getUniqueId(), Member::TYPE_USER);
163 163
 		$this->manageDeprecatedCircles($davCard->getAddressBookId());
164 164
 		$this->manageDeprecatedMembers($davCard);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 *
215 215
 	 */
216 216
 	private function manageDavCard(DavCard $davCard) {
217
-		$this->miscService->log('Updating Card: ' . json_encode($davCard), 1);
217
+		$this->miscService->log('Updating Card: '.json_encode($davCard), 1);
218 218
 		$this->manageCircles($davCard);
219 219
 		$this->manageContact($davCard);
220 220
 	}
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			}
333 333
 		}
334 334
 
335
-		$davCard->setUserId($davCard->getOwner() . ':' . $davCard->getContactId());
335
+		$davCard->setUserId($davCard->getOwner().':'.$davCard->getContactId());
336 336
 
337 337
 		return DavCard::TYPE_CONTACT;
338 338
 	}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 			}
392 392
 
393 393
 			$user = $this->userManager->get($davCard->getOwner());
394
-			$circle = new Circle($this->configService->contactsBackendType(), $group . ' - ' . $user->getDisplayName());
394
+			$circle = new Circle($this->configService->contactsBackendType(), $group.' - '.$user->getDisplayName());
395 395
 			$circle->setContactAddressBook($davCard->getAddressBookId());
396 396
 			$circle->setContactGroupName($group);
397 397
 
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$this->manageDeprecatedCircles();
491 491
 		$users = $this->userManager->search('');
492 492
 		foreach ($users as $user) {
493
-			$books = $this->cardDavBackend->getAddressBooksForUser('principals/users/' . $user->getUID());
493
+			$books = $this->cardDavBackend->getAddressBooksForUser('principals/users/'.$user->getUID());
494 494
 			foreach ($books as $book) {
495 495
 				$this->migrateBook($book['id']);
496 496
 			}
Please login to merge, or discard this patch.
lib/Migration/Version0017Date20200202112903.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@
 block discarded – undo
273 273
 			}
274 274
 
275 275
 			$ak = array_keys($default);
276
-			foreach($ak as $k) {
276
+			foreach ($ak as $k) {
277 277
 //				if (!array_key_exists($k, $row)) {
278 278
 					$copy->setValue($k, $copy->createNamedParameter($default[$k]));
279 279
 //				}
Please login to merge, or discard this patch.