Completed
Pull Request — master (#7193)
by Georg
16:25
created
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 1 patch
Spacing   +22 added lines, -22 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 */
@@ -378,26 +378,26 @@  discard block
 block discarded – undo
378 378
 			}
379 379
 		}
380 380
 
381
-		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']) . ', ' .
381
+		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']).', '.
382 382
 			$l10n->l('datetime', $dtstartDt, ['width' => 'medium|short']);
383 383
 
384 384
 		// always show full date with timezone if timezones are different
385 385
 		if ($startTimezone !== $endTimezone) {
386 386
 			$localeEnd = $l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
387 387
 
388
-			return $localeStart . ' (' . $startTimezone . ') - ' .
389
-				$localeEnd . ' (' . $endTimezone . ')';
388
+			return $localeStart.' ('.$startTimezone.') - '.
389
+				$localeEnd.' ('.$endTimezone.')';
390 390
 		}
391 391
 
392 392
 		// show only end time if date is the same
393 393
 		if ($this->isDayEqual($dtstartDt, $dtendDt)) {
394 394
 			$localeEnd = $l10n->l('time', $dtendDt, ['width' => 'short']);
395 395
 		} else {
396
-			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']) . ', ' .
396
+			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']).', '.
397 397
 				$l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
398 398
 		}
399 399
 
400
-		return  $localeStart . ' - ' . $localeEnd . ' (' . $startTimezone . ')';
400
+		return  $localeStart.' - '.$localeEnd.' ('.$startTimezone.')';
401 401
 	}
402 402
 
403 403
 	/**
@@ -420,15 +420,15 @@  discard block
 block discarded – undo
420 420
 	private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n,
421 421
 										  $method, $summary, $attendeeName, $inviteeName) {
422 422
 		if ($method === self::METHOD_CANCEL) {
423
-			$template->setSubject('Cancelled: ' . $summary);
423
+			$template->setSubject('Cancelled: '.$summary);
424 424
 			$template->addHeading($l10n->t('Invitation canceled'), $l10n->t('Hello %s,', [$attendeeName]));
425 425
 			$template->addBodyText($l10n->t('The meeting »%s« with %s was canceled.', [$summary, $inviteeName]));
426 426
 		} else if ($method === self::METHOD_REPLY) {
427
-			$template->setSubject('Re: ' . $summary);
427
+			$template->setSubject('Re: '.$summary);
428 428
 			$template->addHeading($l10n->t('Invitation updated'), $l10n->t('Hello %s,', [$attendeeName]));
429 429
 			$template->addBodyText($l10n->t('The meeting »%s« with %s was updated.', [$summary, $inviteeName]));
430 430
 		} else {
431
-			$template->setSubject('Invitation: ' . $summary);
431
+			$template->setSubject('Invitation: '.$summary);
432 432
 			$template->addHeading($l10n->t('%s invited you to »%s«', [$inviteeName, $summary]), $l10n->t('Hello %s,', [$attendeeName]));
433 433
 		}
434 434
 
@@ -451,11 +451,11 @@  discard block
 block discarded – undo
451 451
 				$this->getAbsoluteImagePath('filetypes/location.svg'));
452 452
 		}
453 453
 		if ($description) {
454
-			$template->addBodyListItem((string)$description, $l10n->t('Description:'),
454
+			$template->addBodyListItem((string) $description, $l10n->t('Description:'),
455 455
 				$this->getAbsoluteImagePath('filetypes/text.svg'));
456 456
 		}
457 457
 		if ($url) {
458
-			$template->addBodyListItem((string)$url, $l10n->t('Link:'),
458
+			$template->addBodyListItem((string) $url, $l10n->t('Link:'),
459 459
 				$this->getAbsoluteImagePath('filetypes/link.svg'));
460 460
 		}
461 461
 	}
Please login to merge, or discard this patch.