Completed
Push — master ( 496404...ac4e82 )
by Daniel
26:01
created
apps/dav/lib/CalDAV/Schedule/IMipService.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
 		// time of the day
232 232
 		if (!$er->entireDay()) {
233 233
 			$startTime = $this->l10n->l('time', $er->startDateTime(), ['width' => 'short']);
234
-			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' (' . $er->startTimeZone()->getName() . ')' : '';
235
-			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']) . ' (' . $er->endTimeZone()->getName() . ')';
234
+			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' ('.$er->startTimeZone()->getName().')' : '';
235
+			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']).' ('.$er->endTimeZone()->getName().')';
236 236
 		}
237 237
 		// generate localized when string
238 238
 		// TRANSLATORS
@@ -358,14 +358,14 @@  discard block
 block discarded – undo
358 358
 	public function generateWhenStringRecurringDaily(EventReader $er): string {
359 359
 
360 360
 		// initialize
361
-		$interval = (int)$er->recurringInterval();
361
+		$interval = (int) $er->recurringInterval();
362 362
 		$startTime = null;
363 363
 		$conclusion = null;
364 364
 		// time of the day
365 365
 		if (!$er->entireDay()) {
366 366
 			$startTime = $this->l10n->l('time', $er->startDateTime(), ['width' => 'short']);
367
-			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' (' . $er->startTimeZone()->getName() . ')' : '';
368
-			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']) . ' (' . $er->endTimeZone()->getName() . ')';
367
+			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' ('.$er->startTimeZone()->getName().')' : '';
368
+			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']).' ('.$er->endTimeZone()->getName().')';
369 369
 		}
370 370
 		// conclusion
371 371
 		if ($er->recurringConcludes()) {
@@ -409,16 +409,16 @@  discard block
 block discarded – undo
409 409
 	public function generateWhenStringRecurringWeekly(EventReader $er): string {
410 410
 
411 411
 		// initialize
412
-		$interval = (int)$er->recurringInterval();
412
+		$interval = (int) $er->recurringInterval();
413 413
 		$startTime = null;
414 414
 		$conclusion = null;
415 415
 		// days of the week
416
-		$days = implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
416
+		$days = implode(', ', array_map(function($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
417 417
 		// time of the day
418 418
 		if (!$er->entireDay()) {
419 419
 			$startTime = $this->l10n->l('time', $er->startDateTime(), ['width' => 'short']);
420
-			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' (' . $er->startTimeZone()->getName() . ')' : '';
421
-			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']) . ' (' . $er->endTimeZone()->getName() . ')';
420
+			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' ('.$er->startTimeZone()->getName().')' : '';
421
+			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']).' ('.$er->endTimeZone()->getName().')';
422 422
 		}
423 423
 		// conclusion
424 424
 		if ($er->recurringConcludes()) {
@@ -462,21 +462,21 @@  discard block
 block discarded – undo
462 462
 	public function generateWhenStringRecurringMonthly(EventReader $er): string {
463 463
 
464 464
 		// initialize
465
-		$interval = (int)$er->recurringInterval();
465
+		$interval = (int) $er->recurringInterval();
466 466
 		$startTime = null;
467 467
 		$conclusion = null;
468 468
 		// days of month
469 469
 		if ($er->recurringPattern() === 'R') {
470
-			$days = implode(', ', array_map(function ($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())) . ' '
471
-					. implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
470
+			$days = implode(', ', array_map(function($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())).' '
471
+					. implode(', ', array_map(function($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
472 472
 		} else {
473 473
 			$days = implode(', ', $er->recurringDaysOfMonth());
474 474
 		}
475 475
 		// time of the day
476 476
 		if (!$er->entireDay()) {
477 477
 			$startTime = $this->l10n->l('time', $er->startDateTime(), ['width' => 'short']);
478
-			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' (' . $er->startTimeZone()->getName() . ')' : '';
479
-			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']) . ' (' . $er->endTimeZone()->getName() . ')';
478
+			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' ('.$er->startTimeZone()->getName().')' : '';
479
+			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']).' ('.$er->endTimeZone()->getName().')';
480 480
 		}
481 481
 		// conclusion
482 482
 		if ($er->recurringConcludes()) {
@@ -527,23 +527,23 @@  discard block
 block discarded – undo
527 527
 	public function generateWhenStringRecurringYearly(EventReader $er): string {
528 528
 
529 529
 		// initialize
530
-		$interval = (int)$er->recurringInterval();
530
+		$interval = (int) $er->recurringInterval();
531 531
 		$startTime = null;
532 532
 		$conclusion = null;
533 533
 		// months of year
534
-		$months = implode(', ', array_map(function ($value) { return $this->localizeMonthName($value); }, $er->recurringMonthsOfYearNamed()));
534
+		$months = implode(', ', array_map(function($value) { return $this->localizeMonthName($value); }, $er->recurringMonthsOfYearNamed()));
535 535
 		// days of month
536 536
 		if ($er->recurringPattern() === 'R') {
537
-			$days = implode(', ', array_map(function ($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())) . ' '
538
-					. implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
537
+			$days = implode(', ', array_map(function($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())).' '
538
+					. implode(', ', array_map(function($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
539 539
 		} else {
540 540
 			$days = $er->startDateTime()->format('jS');
541 541
 		}
542 542
 		// time of the day
543 543
 		if (!$er->entireDay()) {
544 544
 			$startTime = $this->l10n->l('time', $er->startDateTime(), ['width' => 'short']);
545
-			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' (' . $er->startTimeZone()->getName() . ')' : '';
546
-			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']) . ' (' . $er->endTimeZone()->getName() . ')';
545
+			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' ('.$er->startTimeZone()->getName().')' : '';
546
+			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']).' ('.$er->endTimeZone()->getName().')';
547 547
 		}
548 548
 		// conclusion
549 549
 		if ($er->recurringConcludes()) {
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 			[false, true, false] => $this->l10n->t('Every Year in %1$s on the %2$s between %3$s - %4$s', [$months, $days, $startTime, $endTime]),
576 576
 			[false, true, true] => $this->l10n->t('Every Year in %1$s on the %2$s between %3$s - %4$s until %5$s', [$months, $days, $startTime, $endTime, $conclusion]),
577 577
 			[true, false, false] => $this->l10n->t('Every %1$d Years in %2$s on the %3$s for the entire day', [$interval, $months, $days]),
578
-			[true, false, true] => $this->l10n->t('Every %1$d Years in %2$s on the %3$s for the entire day until %4$s', [$interval, $months,  $days, $conclusion]),
578
+			[true, false, true] => $this->l10n->t('Every %1$d Years in %2$s on the %3$s for the entire day until %4$s', [$interval, $months, $days, $conclusion]),
579 579
 			[true, true, false] => $this->l10n->t('Every %1$d Years in %2$s on the %3$s between %4$s - %5$s', [$interval, $months, $days, $startTime, $endTime]),
580 580
 			[true, true, true] => $this->l10n->t('Every %1$d Years in %2$s on the %3$s between %4$s - %5$s until %6$s', [$interval, $months, $days, $startTime, $endTime, $conclusion]),
581 581
 			default => $this->l10n->t('Could not generate event recurrence statement')
@@ -598,8 +598,8 @@  discard block
 block discarded – undo
598 598
 		// time of the day
599 599
 		if (!$er->entireDay()) {
600 600
 			$startTime = $this->l10n->l('time', $er->startDateTime(), ['width' => 'short']);
601
-			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' (' . $er->startTimeZone()->getName() . ')' : '';
602
-			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']) . ' (' . $er->endTimeZone()->getName() . ')';
601
+			$startTime .= $er->startTimeZone() != $er->endTimeZone() ? ' ('.$er->startTimeZone()->getName().')' : '';
602
+			$endTime = $this->l10n->l('time', $er->endDateTime(), ['width' => 'short']).' ('.$er->endTimeZone()->getName().')';
603 603
 		}
604 604
 		// conclusion
605 605
 		$conclusion = $this->l10n->l('date', $er->recurringConcludesOn(), ['width' => 'long']);
@@ -799,21 +799,21 @@  discard block
 block discarded – undo
799 799
 		$strikethrough = "<span style='text-decoration: line-through'>%s</span>";
800 800
 
801 801
 		$newMeetingWhen = $this->generateWhenString($eventReaderCurrent);
802
-		$newSummary = htmlspecialchars(isset($vEvent->SUMMARY) && (string)$vEvent->SUMMARY !== '' ? (string)$vEvent->SUMMARY : $this->l10n->t('Untitled event'));
803
-		$newDescription = htmlspecialchars(isset($vEvent->DESCRIPTION) && (string)$vEvent->DESCRIPTION !== '' ? (string)$vEvent->DESCRIPTION : $defaultVal);
804
-		$newUrl = isset($vEvent->URL) && (string)$vEvent->URL !== '' ? sprintf('<a href="%1$s">%1$s</a>', $vEvent->URL) : $defaultVal;
805
-		$newLocation = htmlspecialchars(isset($vEvent->LOCATION) && (string)$vEvent->LOCATION !== '' ? (string)$vEvent->LOCATION : $defaultVal);
802
+		$newSummary = htmlspecialchars(isset($vEvent->SUMMARY) && (string) $vEvent->SUMMARY !== '' ? (string) $vEvent->SUMMARY : $this->l10n->t('Untitled event'));
803
+		$newDescription = htmlspecialchars(isset($vEvent->DESCRIPTION) && (string) $vEvent->DESCRIPTION !== '' ? (string) $vEvent->DESCRIPTION : $defaultVal);
804
+		$newUrl = isset($vEvent->URL) && (string) $vEvent->URL !== '' ? sprintf('<a href="%1$s">%1$s</a>', $vEvent->URL) : $defaultVal;
805
+		$newLocation = htmlspecialchars(isset($vEvent->LOCATION) && (string) $vEvent->LOCATION !== '' ? (string) $vEvent->LOCATION : $defaultVal);
806 806
 		$newLocationHtml = $this->linkify($newLocation) ?? $newLocation;
807 807
 
808 808
 		$data = [];
809 809
 		$data['meeting_when_html'] = $newMeetingWhen === '' ?: sprintf($strikethrough, $newMeetingWhen);
810 810
 		$data['meeting_when'] = $newMeetingWhen;
811 811
 		$data['meeting_title_html'] = sprintf($strikethrough, $newSummary);
812
-		$data['meeting_title'] = $newSummary !== '' ? $newSummary: $this->l10n->t('Untitled event');
812
+		$data['meeting_title'] = $newSummary !== '' ? $newSummary : $this->l10n->t('Untitled event');
813 813
 		$data['meeting_description_html'] = $newDescription !== '' ? sprintf($strikethrough, $newDescription) : '';
814 814
 		$data['meeting_description'] = $newDescription;
815 815
 		$data['meeting_url_html'] = $newUrl !== '' ? sprintf($strikethrough, $newUrl) : '';
816
-		$data['meeting_url'] = isset($vEvent->URL) ? (string)$vEvent->URL : '';
816
+		$data['meeting_url'] = isset($vEvent->URL) ? (string) $vEvent->URL : '';
817 817
 		$data['meeting_location_html'] = $newLocationHtml !== '' ? sprintf($strikethrough, $newLocationHtml) : '';
818 818
 		$data['meeting_location'] = $newLocation;
819 819
 		return $data;
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 		$component = $vObject->VEVENT;
831 831
 
832 832
 		if (isset($component->RRULE)) {
833
-			$it = new EventIterator($vObject, (string)$component->UID);
833
+			$it = new EventIterator($vObject, (string) $component->UID);
834 834
 			$maxDate = new \DateTime(IMipPlugin::MAX_DATE);
835 835
 			if ($it->isInfinite()) {
836 836
 				return $maxDate->getTimestamp();
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
 			$interval = $dateInterval->m;
1233 1233
 			$scale = 'month';
1234 1234
 		} elseif ($dateInterval->d >= 7) {
1235
-			$interval = (int)($dateInterval->d / 7);
1235
+			$interval = (int) ($dateInterval->d / 7);
1236 1236
 			$scale = 'week';
1237 1237
 		} elseif ($dateInterval->d > 0) {
1238 1238
 			$interval = $dateInterval->d;
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @param VEvent $vevent
131 131
 	 */
132 132
 	private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n, VEvent $vevent):void {
133
-		$template->setSubject('Notification: ' . $this->getTitleFromVEvent($vevent, $l10n));
133
+		$template->setSubject('Notification: '.$this->getTitleFromVEvent($vevent, $l10n));
134 134
 		$template->addHeading($this->getTitleFromVEvent($vevent, $l10n));
135 135
 	}
136 136
 
@@ -156,18 +156,18 @@  discard block
 block discarded – undo
156 156
 
157 157
 		if (isset($vevent->LOCATION)) {
158 158
 			$template->addBodyListItem(
159
-				htmlspecialchars((string)$vevent->LOCATION),
159
+				htmlspecialchars((string) $vevent->LOCATION),
160 160
 				$l10n->t('Where:'),
161 161
 				$this->getAbsoluteImagePath('actions/address.png'),
162
-				htmlspecialchars((string)$vevent->LOCATION),
162
+				htmlspecialchars((string) $vevent->LOCATION),
163 163
 			);
164 164
 		}
165 165
 		if (isset($vevent->DESCRIPTION)) {
166 166
 			$template->addBodyListItem(
167
-				htmlspecialchars((string)$vevent->DESCRIPTION),
167
+				htmlspecialchars((string) $vevent->DESCRIPTION),
168 168
 				$l10n->t('Description:'),
169 169
 				$this->getAbsoluteImagePath('actions/more.png'),
170
-				htmlspecialchars((string)$vevent->DESCRIPTION),
170
+				htmlspecialchars((string) $vevent->DESCRIPTION),
171 171
 			);
172 172
 		}
173 173
 	}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 * @param VEvent $vevent
183 183
 	 * @return array|null
184 184
 	 */
185
-	private function getOrganizerEMailAndNameFromEvent(VEvent $vevent):?array {
185
+	private function getOrganizerEMailAndNameFromEvent(VEvent $vevent): ?array {
186 186
 		if (!$vevent->ORGANIZER) {
187 187
 			return null;
188 188
 		}
@@ -405,10 +405,10 @@  discard block
 block discarded – undo
405 405
 			]);
406 406
 
407 407
 			return $localeStart
408
-				. ' (' . $startTimezone . ') '
408
+				. ' ('.$startTimezone.') '
409 409
 				. ' - '
410 410
 				. $localeEnd
411
-				. ' (' . $endTimezone . ')';
411
+				. ' ('.$endTimezone.')';
412 412
 		}
413 413
 
414 414
 		// Show only the time if the day is the same
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		return $localeStart
423 423
 			. ' - '
424 424
 			. $localeEnd
425
-			. ' (' . $startTimezone . ')';
425
+			. ' ('.$startTimezone.')';
426 426
 	}
427 427
 
428 428
 	private function isDayEqual(DateTime $dtStart,
@@ -431,24 +431,24 @@  discard block
 block discarded – undo
431 431
 	}
432 432
 
433 433
 	private function getWeekDayName(IL10N $l10n, DateTime $dt):string {
434
-		return (string)$l10n->l('weekdayName', $dt, ['width' => 'abbreviated']);
434
+		return (string) $l10n->l('weekdayName', $dt, ['width' => 'abbreviated']);
435 435
 	}
436 436
 
437 437
 	private function getDateString(IL10N $l10n, DateTime $dt):string {
438
-		return (string)$l10n->l('date', $dt, ['width' => 'medium']);
438
+		return (string) $l10n->l('date', $dt, ['width' => 'medium']);
439 439
 	}
440 440
 
441 441
 	private function getDateTimeString(IL10N $l10n, DateTime $dt):string {
442
-		return (string)$l10n->l('datetime', $dt, ['width' => 'medium|short']);
442
+		return (string) $l10n->l('datetime', $dt, ['width' => 'medium|short']);
443 443
 	}
444 444
 
445 445
 	private function getTimeString(IL10N $l10n, DateTime $dt):string {
446
-		return (string)$l10n->l('time', $dt, ['width' => 'short']);
446
+		return (string) $l10n->l('time', $dt, ['width' => 'short']);
447 447
 	}
448 448
 
449 449
 	private function getTitleFromVEvent(VEvent $vevent, IL10N $l10n):string {
450 450
 		if (isset($vevent->SUMMARY)) {
451
-			return (string)$vevent->SUMMARY;
451
+			return (string) $vevent->SUMMARY;
452 452
 		}
453 453
 
454 454
 		return $l10n->t('Untitled event');
Please login to merge, or discard this patch.