Completed
Pull Request — master (#4307)
by Lukas
20:16 queued 06:52
created
apps/sharebymail/lib/ShareByMailProvider.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 				$share->getShareOwner(),
235 235
 				$share->getSharedBy(), $share->getSharedWith());
236 236
 		} catch (HintException $hintException) {
237
-			$this->logger->error('Failed to send share by mail: ' . $hintException->getMessage());
237
+			$this->logger->error('Failed to send share by mail: '.$hintException->getMessage());
238 238
 			$this->removeShareFromTable($shareId);
239 239
 			throw $hintException;
240 240
 		} catch (\Exception $e) {
241
-			$this->logger->error('Failed to send share by mail: ' . $e->getMessage());
241
+			$this->logger->error('Failed to send share by mail: '.$e->getMessage());
242 242
 			$this->removeShareFromTable($shareId);
243 243
 			throw new HintException('Failed to send share by mail',
244 244
 				$this->l->t('Failed to send share by E-mail'));
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 		$ownerDisplayName = ($ownerUser instanceof IUser) ? $ownerUser->getDisplayName() : $owner;
255 255
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
256 256
 		if ($owner === $initiator) {
257
-			$subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename));
257
+			$subject = (string) $this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename));
258 258
 		} else {
259
-			$subject = (string)$this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName));
259
+			$subject = (string) $this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName));
260 260
 		}
261 261
 
262 262
 		$message = $this->mailer->createMessage();
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 		if ($owner === $initiator) {
270 270
 			$text = $this->l->t('%s shared »%s« with you.', [$ownerDisplayName, $filename]);
271 271
 		} else {
272
-			$text= $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]);
272
+			$text = $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]);
273 273
 		}
274 274
 
275
-		$text .= ' ' . $this->l->t('Click the button below to open it.');
275
+		$text .= ' '.$this->l->t('Click the button below to open it.');
276 276
 
277 277
 		$emailTemplate->addBodyText($text);
278 278
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
 		$initiatorUser = $this->userManager->get($initiator);
307 307
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
308
-		$subject = (string)$this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
308
+		$subject = (string) $this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
309 309
 
310 310
 		$message = $this->mailer->createMessage();
311 311
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 */
339 339
 	protected function generateToken() {
340 340
 		$token = $this->secureRandom->generate(
341
-			15, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS);
341
+			15, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS);
342 342
 		return $token;
343 343
 	}
344 344
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			->orderBy('id');
360 360
 
361 361
 		$cursor = $qb->execute();
362
-		while($data = $cursor->fetch()) {
362
+		while ($data = $cursor->fetch()) {
363 363
 			$children[] = $this->createShareObject($data);
364 364
 		}
365 365
 		$cursor->closeCursor();
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		$qb->execute();
403 403
 		$id = $qb->getLastInsertId();
404 404
 
405
-		return (int)$id;
405
+		return (int) $id;
406 406
 	}
407 407
 
408 408
 	/**
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 		// a real password was given
420 420
 		$validPassword = $plainTextPassword !== null && $plainTextPassword !== '';
421 421
 
422
-		if($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
422
+		if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
423 423
 			$this->sendPassword($share->getNode()->getName(), $share->getSharedBy(), $share->getSharedWith(), $plainTextPassword);
424 424
 		}
425 425
 		/*
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 
514 514
 		$cursor = $qb->execute();
515 515
 		$shares = [];
516
-		while($data = $cursor->fetch()) {
516
+		while ($data = $cursor->fetch()) {
517 517
 			$shares[] = $this->createShareObject($data);
518 518
 		}
519 519
 		$cursor->closeCursor();
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 			->execute();
566 566
 
567 567
 		$shares = [];
568
-		while($data = $cursor->fetch()) {
568
+		while ($data = $cursor->fetch()) {
569 569
 			$shares[] = $this->createShareObject($data);
570 570
 		}
571 571
 		$cursor->closeCursor();
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 
605 605
 		$cursor = $qb->execute();
606 606
 
607
-		while($data = $cursor->fetch()) {
607
+		while ($data = $cursor->fetch()) {
608 608
 			$shares[] = $this->createShareObject($data);
609 609
 		}
610 610
 		$cursor->closeCursor();
@@ -667,15 +667,15 @@  discard block
 block discarded – undo
667 667
 	protected function createShareObject($data) {
668 668
 
669 669
 		$share = new Share($this->rootFolder, $this->userManager);
670
-		$share->setId((int)$data['id'])
671
-			->setShareType((int)$data['share_type'])
672
-			->setPermissions((int)$data['permissions'])
670
+		$share->setId((int) $data['id'])
671
+			->setShareType((int) $data['share_type'])
672
+			->setPermissions((int) $data['permissions'])
673 673
 			->setTarget($data['file_target'])
674
-			->setMailSend((bool)$data['mail_send'])
674
+			->setMailSend((bool) $data['mail_send'])
675 675
 			->setToken($data['token']);
676 676
 
677 677
 		$shareTime = new \DateTime();
678
-		$shareTime->setTimestamp((int)$data['stime']);
678
+		$shareTime->setTimestamp((int) $data['stime']);
679 679
 		$share->setShareTime($shareTime);
680 680
 		$share->setSharedWith($data['share_with']);
681 681
 		$share->setPassword($data['password']);
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 		} else {
687 687
 			//OLD SHARE
688 688
 			$share->setSharedBy($data['uid_owner']);
689
-			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
689
+			$path = $this->getNode($share->getSharedBy(), (int) $data['file_source']);
690 690
 
691 691
 			$owner = $path->getOwner();
692 692
 			$share->setShareOwner($owner->getUID());
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 			}
700 700
 		}
701 701
 
702
-		$share->setNodeId((int)$data['file_source']);
702
+		$share->setNodeId((int) $data['file_source']);
703 703
 		$share->setNodeType($data['item_type']);
704 704
 
705 705
 		$share->setProviderId($this->identifier());
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 			);
819 819
 		}
820 820
 
821
-		$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
821
+		$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
822 822
 		$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
823 823
 
824 824
 		$qb->orderBy('id');
Please login to merge, or discard this patch.
lib/private/Mail/EMailTemplate.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 		}
347 347
 
348 348
 		$this->htmlBody .= vsprintf($this->heading, [htmlspecialchars($title)]);
349
-		$this->plainBody .= $plainTitle . PHP_EOL . PHP_EOL;
349
+		$this->plainBody .= $plainTitle.PHP_EOL.PHP_EOL;
350 350
 	}
351 351
 
352 352
 	/**
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		}
370 370
 
371 371
 		$this->htmlBody .= vsprintf($this->bodyText, [htmlspecialchars($text)]);
372
-		$this->plainBody .= $plainText . PHP_EOL . PHP_EOL;
372
+		$this->plainBody .= $plainText.PHP_EOL.PHP_EOL;
373 373
 	}
374 374
 
375 375
 	/**
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 		$color = $this->themingDefaults->getColorPrimary();
408 408
 
409 409
 		$this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, htmlspecialchars($textLeft), $urlRight, htmlspecialchars($textRight)]);
410
-		$this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL;
411
-		$this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL;
410
+		$this->plainBody .= $plainTextLeft.': '.$urlLeft.PHP_EOL;
411
+		$this->plainBody .= $plainTextRight.': '.$urlRight.PHP_EOL.PHP_EOL;
412 412
 
413 413
 	}
414 414
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 		$color = $this->themingDefaults->getColorPrimary();
434 434
 		$this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, htmlspecialchars($text)]);
435
-		$this->plainBody .= $text . ': ' . $url . PHP_EOL;
435
+		$this->plainBody .= $text.': '.$url.PHP_EOL;
436 436
 
437 437
 	}
438 438
 
@@ -442,8 +442,8 @@  discard block
 block discarded – undo
442 442
 	 * @param string $text If the text is empty the default "Name - Slogan<br>This is an automatically generated email" will be used
443 443
 	 */
444 444
 	public function addFooter($text = '') {
445
-		if($text === '') {
446
-			$text = $this->themingDefaults->getName() . ' - ' . $this->themingDefaults->getSlogan() . '<br>' . $this->l10n->t('This is an automatically generated email, please do not reply.');
445
+		if ($text === '') {
446
+			$text = $this->themingDefaults->getName().' - '.$this->themingDefaults->getSlogan().'<br>'.$this->l10n->t('This is an automatically generated email, please do not reply.');
447 447
 		}
448 448
 
449 449
 		if ($this->footerAdded) {
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 
459 459
 		$this->htmlBody .= vsprintf($this->footer, [$text]);
460 460
 		$this->htmlBody .= $this->tail;
461
-		$this->plainBody .= '--' . PHP_EOL;
461
+		$this->plainBody .= '--'.PHP_EOL;
462 462
 		$this->plainBody .= str_replace('<br>', PHP_EOL, $text);
463 463
 	}
464 464
 
Please login to merge, or discard this patch.