Passed
Push — master ( 50ad70...e26666 )
by Roeland
13:47 queued 12s
created
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
 		}
241 241
 
242 242
 		$data = [
243
-			'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
244
-			'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
245
-			'meeting_title' => (string)$meetingTitle ?: $defaultVal,
246
-			'meeting_description' => (string)$meetingDescription ?: $defaultVal,
247
-			'meeting_url' => (string)$meetingUrl ?: $defaultVal,
243
+			'attendee_name' => (string) $meetingAttendeeName ?: $defaultVal,
244
+			'invitee_name' => (string) $meetingInviteeName ?: $defaultVal,
245
+			'meeting_title' => (string) $meetingTitle ?: $defaultVal,
246
+			'meeting_description' => (string) $meetingDescription ?: $defaultVal,
247
+			'meeting_url' => (string) $meetingUrl ?: $defaultVal,
248 248
 		];
249 249
 
250 250
 		$fromEMail = Util::getDefaultEmailAddress('invitations-noreply');
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 			->setReplyTo([$sender => $senderName])
256 256
 			->setTo([$recipient => $recipientName]);
257 257
 
258
-		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data);
258
+		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.'.$method, $data);
259 259
 		$template->addHeader();
260 260
 
261 261
 		$summary = ((string) $summary !== '') ? (string) $summary : $l10n->t('Untitled event');
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
 
305 305
 		$attachment = $this->mailer->createAttachment(
306 306
 			$iTipMessage->message->serialize(),
307
-			'event.ics',// TODO(leon): Make file name unique, e.g. add event id
308
-			'text/calendar; method=' . $iTipMessage->method
307
+			'event.ics', // TODO(leon): Make file name unique, e.g. add event id
308
+			'text/calendar; method='.$iTipMessage->method
309 309
 		);
310 310
 		$message->attach($attachment);
311 311
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 				$this->logger->error('Unable to deliver message to {failed}', ['app' => 'dav', 'failed' =>  implode(', ', $failed)]);
317 317
 				$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
318 318
 			}
319
-		} catch(\Exception $ex) {
319
+		} catch (\Exception $ex) {
320 320
 			$this->logger->logException($ex, ['app' => 'dav']);
321 321
 			$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
322 322
 		}
@@ -352,13 +352,13 @@  discard block
 block discarded – undo
352 352
 				$lastOccurrence = $firstOccurrence;
353 353
 			}
354 354
 		} else {
355
-			$it = new EventIterator($vObject, (string)$component->UID);
355
+			$it = new EventIterator($vObject, (string) $component->UID);
356 356
 			$maxDate = new \DateTime(self::MAX_DATE);
357 357
 			if ($it->isInfinite()) {
358 358
 				$lastOccurrence = $maxDate->getTimestamp();
359 359
 			} else {
360 360
 				$end = $it->getDtEnd();
361
-				while($it->valid() && $end < $maxDate) {
361
+				while ($it->valid() && $end < $maxDate) {
362 362
 					$end = $it->getDtEnd();
363 363
 					$it->next();
364 364
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 			$localeStart = $l10n->l('date', $dtstartDt, ['width' => 'medium']);
453 453
 			$localeEnd = $l10n->l('date', $dtendDt, ['width' => 'medium']);
454 454
 
455
-			return $localeStart . ' - ' . $localeEnd;
455
+			return $localeStart.' - '.$localeEnd;
456 456
 		}
457 457
 
458 458
 		/** @var Property\ICalendar\DateTime $dtstart */
@@ -471,26 +471,26 @@  discard block
 block discarded – undo
471 471
 			}
472 472
 		}
473 473
 
474
-		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']) . ', ' .
474
+		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']).', '.
475 475
 			$l10n->l('datetime', $dtstartDt, ['width' => 'medium|short']);
476 476
 
477 477
 		// always show full date with timezone if timezones are different
478 478
 		if ($startTimezone !== $endTimezone) {
479 479
 			$localeEnd = $l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
480 480
 
481
-			return $localeStart . ' (' . $startTimezone . ') - ' .
482
-				$localeEnd . ' (' . $endTimezone . ')';
481
+			return $localeStart.' ('.$startTimezone.') - '.
482
+				$localeEnd.' ('.$endTimezone.')';
483 483
 		}
484 484
 
485 485
 		// show only end time if date is the same
486 486
 		if ($this->isDayEqual($dtstartDt, $dtendDt)) {
487 487
 			$localeEnd = $l10n->l('time', $dtendDt, ['width' => 'short']);
488 488
 		} else {
489
-			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']) . ', ' .
489
+			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']).', '.
490 490
 				$l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
491 491
 		}
492 492
 
493
-		return  $localeStart . ' - ' . $localeEnd . ' (' . $startTimezone . ')';
493
+		return  $localeStart.' - '.$localeEnd.' ('.$startTimezone.')';
494 494
 	}
495 495
 
496 496
 	/**
@@ -513,15 +513,15 @@  discard block
 block discarded – undo
513 513
 	private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n,
514 514
 										  $method, $summary, $attendeeName, $inviteeName) {
515 515
 		if ($method === self::METHOD_CANCEL) {
516
-			$template->setSubject('Cancelled: ' . $summary);
516
+			$template->setSubject('Cancelled: '.$summary);
517 517
 			$template->addHeading($l10n->t('Invitation canceled'), $l10n->t('Hello %s,', [$attendeeName]));
518 518
 			$template->addBodyText($l10n->t('The meeting »%1$s« with %2$s was canceled.', [$summary, $inviteeName]));
519 519
 		} else if ($method === self::METHOD_REPLY) {
520
-			$template->setSubject('Re: ' . $summary);
520
+			$template->setSubject('Re: '.$summary);
521 521
 			$template->addHeading($l10n->t('Invitation updated'), $l10n->t('Hello %s,', [$attendeeName]));
522 522
 			$template->addBodyText($l10n->t('The meeting »%1$s« with %2$s was updated.', [$summary, $inviteeName]));
523 523
 		} else {
524
-			$template->setSubject('Invitation: ' . $summary);
524
+			$template->setSubject('Invitation: '.$summary);
525 525
 			$template->addHeading($l10n->t('%1$s invited you to »%2$s«', [$inviteeName, $summary]), $l10n->t('Hello %s,', [$attendeeName]));
526 526
 		}
527 527
 	}
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
 				$this->getAbsoluteImagePath('filetypes/location.svg'));
544 544
 		}
545 545
 		if ($description) {
546
-			$template->addBodyListItem((string)$description, $l10n->t('Description:'),
546
+			$template->addBodyListItem((string) $description, $l10n->t('Description:'),
547 547
 				$this->getAbsoluteImagePath('filetypes/text.svg'));
548 548
 		}
549 549
 		if ($url) {
550
-			$template->addBodyListItem((string)$url, $l10n->t('Link:'),
550
+			$template->addBodyListItem((string) $url, $l10n->t('Link:'),
551 551
 				$this->getAbsoluteImagePath('filetypes/link.svg'));
552 552
 		}
553 553
 	}
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 * @return string
601 601
 	 */
602 602
 	private function createInvitationToken(Message $iTipMessage, $lastOccurrence):string {
603
-		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
603
+		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
604 604
 
605 605
 		/** @var VEvent $vevent */
606 606
 		$vevent = $iTipMessage->message->VEVENT;
Please login to merge, or discard this patch.