Passed
Push — master ( fdcc65...954290 )
by Roeland
09:42 queued 10s
created
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 		}
218 218
 
219 219
 		$data = array(
220
-			'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
221
-			'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
222
-			'meeting_title' => (string)$meetingTitle ?: $defaultVal,
223
-			'meeting_description' => (string)$meetingDescription ?: $defaultVal,
224
-			'meeting_url' => (string)$meetingUrl ?: $defaultVal,
220
+			'attendee_name' => (string) $meetingAttendeeName ?: $defaultVal,
221
+			'invitee_name' => (string) $meetingInviteeName ?: $defaultVal,
222
+			'meeting_title' => (string) $meetingTitle ?: $defaultVal,
223
+			'meeting_description' => (string) $meetingDescription ?: $defaultVal,
224
+			'meeting_url' => (string) $meetingUrl ?: $defaultVal,
225 225
 		);
226 226
 
227 227
 		$fromEMail = \OCP\Util::getDefaultEmailAddress('invitations-noreply');
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 			->setReplyTo([$sender => $senderName])
233 233
 			->setTo([$recipient => $recipientName]);
234 234
 
235
-		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data);
235
+		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.'.$method, $data);
236 236
 		$template->addHeader();
237 237
 
238 238
 		$this->addSubjectAndHeading($template, $l10n, $method, $summary,
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
 
280 280
 		$attachment = $this->mailer->createAttachment(
281 281
 			$iTipMessage->message->serialize(),
282
-			'event.ics',// TODO(leon): Make file name unique, e.g. add event id
283
-			'text/calendar; method=' . $iTipMessage->method
282
+			'event.ics', // TODO(leon): Make file name unique, e.g. add event id
283
+			'text/calendar; method='.$iTipMessage->method
284 284
 		);
285 285
 		$message->attach($attachment);
286 286
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				$this->logger->error('Unable to deliver message to {failed}', ['app' => 'dav', 'failed' =>  implode(', ', $failed)]);
292 292
 				$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
293 293
 			}
294
-		} catch(\Exception $ex) {
294
+		} catch (\Exception $ex) {
295 295
 			$this->logger->logException($ex, ['app' => 'dav']);
296 296
 			$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
297 297
 		}
@@ -327,13 +327,13 @@  discard block
 block discarded – undo
327 327
 				$lastOccurrence = $firstOccurrence;
328 328
 			}
329 329
 		} else {
330
-			$it = new EventIterator($vObject, (string)$component->UID);
330
+			$it = new EventIterator($vObject, (string) $component->UID);
331 331
 			$maxDate = new \DateTime(self::MAX_DATE);
332 332
 			if ($it->isInfinite()) {
333 333
 				$lastOccurrence = $maxDate->getTimestamp();
334 334
 			} else {
335 335
 				$end = $it->getDtEnd();
336
-				while($it->valid() && $end < $maxDate) {
336
+				while ($it->valid() && $end < $maxDate) {
337 337
 					$end = $it->getDtEnd();
338 338
 					$it->next();
339 339
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 			$localeStart = $l10n->l('date', $dtstartDt, ['width' => 'medium']);
424 424
 			$localeEnd = $l10n->l('date', $dtendDt, ['width' => 'medium']);
425 425
 
426
-			return $localeStart . ' - ' . $localeEnd;
426
+			return $localeStart.' - '.$localeEnd;
427 427
 		}
428 428
 
429 429
 		/** @var Property\ICalendar\DateTime $dtstart */
@@ -442,26 +442,26 @@  discard block
 block discarded – undo
442 442
 			}
443 443
 		}
444 444
 
445
-		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']) . ', ' .
445
+		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']).', '.
446 446
 			$l10n->l('datetime', $dtstartDt, ['width' => 'medium|short']);
447 447
 
448 448
 		// always show full date with timezone if timezones are different
449 449
 		if ($startTimezone !== $endTimezone) {
450 450
 			$localeEnd = $l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
451 451
 
452
-			return $localeStart . ' (' . $startTimezone . ') - ' .
453
-				$localeEnd . ' (' . $endTimezone . ')';
452
+			return $localeStart.' ('.$startTimezone.') - '.
453
+				$localeEnd.' ('.$endTimezone.')';
454 454
 		}
455 455
 
456 456
 		// show only end time if date is the same
457 457
 		if ($this->isDayEqual($dtstartDt, $dtendDt)) {
458 458
 			$localeEnd = $l10n->l('time', $dtendDt, ['width' => 'short']);
459 459
 		} else {
460
-			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']) . ', ' .
460
+			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']).', '.
461 461
 				$l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
462 462
 		}
463 463
 
464
-		return  $localeStart . ' - ' . $localeEnd . ' (' . $startTimezone . ')';
464
+		return  $localeStart.' - '.$localeEnd.' ('.$startTimezone.')';
465 465
 	}
466 466
 
467 467
 	/**
@@ -484,15 +484,15 @@  discard block
 block discarded – undo
484 484
 	private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n,
485 485
 										  $method, $summary, $attendeeName, $inviteeName) {
486 486
 		if ($method === self::METHOD_CANCEL) {
487
-			$template->setSubject('Cancelled: ' . $summary);
487
+			$template->setSubject('Cancelled: '.$summary);
488 488
 			$template->addHeading($l10n->t('Invitation canceled'), $l10n->t('Hello %s,', [$attendeeName]));
489 489
 			$template->addBodyText($l10n->t('The meeting »%1$s« with %2$s was canceled.', [$summary, $inviteeName]));
490 490
 		} else if ($method === self::METHOD_REPLY) {
491
-			$template->setSubject('Re: ' . $summary);
491
+			$template->setSubject('Re: '.$summary);
492 492
 			$template->addHeading($l10n->t('Invitation updated'), $l10n->t('Hello %s,', [$attendeeName]));
493 493
 			$template->addBodyText($l10n->t('The meeting »%1$s« with %2$s was updated.', [$summary, $inviteeName]));
494 494
 		} else {
495
-			$template->setSubject('Invitation: ' . $summary);
495
+			$template->setSubject('Invitation: '.$summary);
496 496
 			$template->addHeading($l10n->t('%1$s invited you to »%2$s«', [$inviteeName, $summary]), $l10n->t('Hello %s,', [$attendeeName]));
497 497
 		}
498 498
 	}
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
 				$this->getAbsoluteImagePath('filetypes/location.svg'));
515 515
 		}
516 516
 		if ($description) {
517
-			$template->addBodyListItem((string)$description, $l10n->t('Description:'),
517
+			$template->addBodyListItem((string) $description, $l10n->t('Description:'),
518 518
 				$this->getAbsoluteImagePath('filetypes/text.svg'));
519 519
 		}
520 520
 		if ($url) {
521
-			$template->addBodyListItem((string)$url, $l10n->t('Link:'),
521
+			$template->addBodyListItem((string) $url, $l10n->t('Link:'),
522 522
 				$this->getAbsoluteImagePath('filetypes/link.svg'));
523 523
 		}
524 524
 	}
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 	 * @return string
572 572
 	 */
573 573
 	private function createInvitationToken(Message $iTipMessage, $lastOccurrence):string {
574
-		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
574
+		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
575 575
 
576 576
 		/** @var VEvent $vevent */
577 577
 		$vevent = $iTipMessage->message->VEVENT;
Please login to merge, or discard this patch.