Completed
Pull Request — master (#7173)
by Georg
12:55
created
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
 		}
202 202
 
203 203
 		$data = array(
204
-			'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
205
-			'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
206
-			'meeting_title' => (string)$meetingTitle ?: $defaultVal,
207
-			'meeting_description' => (string)$meetingDescription ?: $defaultVal,
208
-			'meeting_url' => (string)$meetingUrl ?: $defaultVal,
204
+			'attendee_name' => (string) $meetingAttendeeName ?: $defaultVal,
205
+			'invitee_name' => (string) $meetingInviteeName ?: $defaultVal,
206
+			'meeting_title' => (string) $meetingTitle ?: $defaultVal,
207
+			'meeting_description' => (string) $meetingDescription ?: $defaultVal,
208
+			'meeting_url' => (string) $meetingUrl ?: $defaultVal,
209 209
 		);
210 210
 
211 211
 		$fromEMail = \OCP\Util::getDefaultEmailAddress('invitations-noreply');
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			->setReplyTo([$sender => $senderName])
217 217
 			->setTo([$recipient => $recipientName]);
218 218
 
219
-		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data);
219
+		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.'.$method, $data);
220 220
 		$template->addHeader();
221 221
 
222 222
 		$this->addSubjectAndHeading($template, $l10n, $method, $summary,
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
 
230 230
 		$attachment = $this->mailer->createAttachment(
231 231
 			$iTipMessage->message->serialize(),
232
-			'event.ics',// TODO(leon): Make file name unique, e.g. add event id
233
-			'text/calendar; method=' . $iTipMessage->method
232
+			'event.ics', // TODO(leon): Make file name unique, e.g. add event id
233
+			'text/calendar; method='.$iTipMessage->method
234 234
 		);
235 235
 		$message->attach($attachment);
236 236
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 				$this->logger->error('Unable to deliver message to {failed}', ['app' => 'dav', 'failed' =>  implode(', ', $failed)]);
242 242
 				$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
243 243
 			}
244
-		} catch(\Exception $ex) {
244
+		} catch (\Exception $ex) {
245 245
 			$this->logger->logException($ex, ['app' => 'dav']);
246 246
 			$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
247 247
 		}
@@ -277,13 +277,13 @@  discard block
 block discarded – undo
277 277
 				$lastOccurrence = $firstOccurrence;
278 278
 			}
279 279
 		} else {
280
-			$it = new EventIterator($vObject, (string)$component->UID);
280
+			$it = new EventIterator($vObject, (string) $component->UID);
281 281
 			$maxDate = new \DateTime(self::MAX_DATE);
282 282
 			if ($it->isInfinite()) {
283 283
 				$lastOccurrence = $maxDate->getTimestamp();
284 284
 			} else {
285 285
 				$end = $it->getDtEnd();
286
-				while($it->valid() && $end < $maxDate) {
286
+				while ($it->valid() && $end < $maxDate) {
287 287
 					$end = $it->getDtEnd();
288 288
 					$it->next();
289 289
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			$localeStart = $l10n->l('date', $dtstartDt, ['width' => 'medium']);
360 360
 			$localeEnd = $l10n->l('date', $dtendDt, ['width' => 'medium']);
361 361
 
362
-			return $localeStart . ' - ' . $localeEnd;
362
+			return $localeStart.' - '.$localeEnd;
363 363
 		}
364 364
 
365 365
 		/** @var Property\ICalendar\DateTime $dtstart */
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 		if ($startTimezone !== $endTimezone) {
385 385
 			$localeEnd = $l10n->l('datetime', $dtendDt, ['width' => 'medium']);
386 386
 
387
-			return $localeStart . ' (' . $startTimezone . ') - ' .
388
-				$localeEnd . ' (' . $endTimezone . ')';
387
+			return $localeStart.' ('.$startTimezone.') - '.
388
+				$localeEnd.' ('.$endTimezone.')';
389 389
 		}
390 390
 
391 391
 		// show only end time if date is the same
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 			$localeEnd = $l10n->l('datetime', $dtendDt, ['width' => 'medium']);
396 396
 		}
397 397
 
398
-		return  $localeStart . ' - ' . $localeEnd . ' (' . $startTimezone . ')';
398
+		return  $localeStart.' - '.$localeEnd.' ('.$startTimezone.')';
399 399
 	}
400 400
 
401 401
 	/**
@@ -418,15 +418,15 @@  discard block
 block discarded – undo
418 418
 	private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n,
419 419
 										  $method, $summary, $attendeeName, $inviteeName) {
420 420
 		if ($method === self::METHOD_CANCEL) {
421
-			$template->setSubject('Cancelled: ' . $summary);
421
+			$template->setSubject('Cancelled: '.$summary);
422 422
 			$template->addHeading($l10n->t('Invitation canceled'), $l10n->t('Hello %s,', [$attendeeName]));
423 423
 			$template->addBodyText($l10n->t('The meeting »%s« with %s was canceled.', [$summary, $inviteeName]));
424 424
 		} else if ($method === self::METHOD_REPLY) {
425
-			$template->setSubject('Re: ' . $summary);
425
+			$template->setSubject('Re: '.$summary);
426 426
 			$template->addHeading($l10n->t('Invitation updated'), $l10n->t('Hello %s,', [$attendeeName]));
427 427
 			$template->addBodyText($l10n->t('The meeting »%s« with %s was updated.', [$summary, $inviteeName]));
428 428
 		} else {
429
-			$template->setSubject('Invitation: ' . $summary);
429
+			$template->setSubject('Invitation: '.$summary);
430 430
 			$template->addHeading($l10n->t('%s invited you to »%s«', [$inviteeName, $summary]), $l10n->t('Hello %s,', [$attendeeName]));
431 431
 		}
432 432
 
@@ -449,11 +449,11 @@  discard block
 block discarded – undo
449 449
 				$this->getAbsoluteImagePath('filetypes/location.svg'));
450 450
 		}
451 451
 		if ($description) {
452
-			$template->addBodyListItem((string)$description, $l10n->t('Description:'),
452
+			$template->addBodyListItem((string) $description, $l10n->t('Description:'),
453 453
 				$this->getAbsoluteImagePath('filetypes/text.svg'));
454 454
 		}
455 455
 		if ($url) {
456
-			$template->addBodyListItem((string)$url, $l10n->t('Link:'),
456
+			$template->addBodyListItem((string) $url, $l10n->t('Link:'),
457 457
 				$this->getAbsoluteImagePath('filetypes/link.svg'));
458 458
 		}
459 459
 	}
Please login to merge, or discard this patch.