@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $calendar = $this->ensureCalendarExists($principalUri); |
| 149 | 149 | foreach (['', '-death', '-anniversary'] as $tag) { |
| 150 | - $objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics'; |
|
| 150 | + $objectUri = $book['uri'].'-'.$cardUri.$tag.'.ics'; |
|
| 151 | 151 | $this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri); |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @return array|null |
| 159 | 159 | * @throws \Sabre\DAV\Exception\BadRequest |
| 160 | 160 | */ |
| 161 | - public function ensureCalendarExists(string $principal):?array { |
|
| 161 | + public function ensureCalendarExists(string $principal): ?array { |
|
| 162 | 162 | $calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); |
| 163 | 163 | if (!is_null($calendar)) { |
| 164 | 164 | return $calendar; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function buildDateFromContact(string $cardData, |
| 183 | 183 | string $dateField, |
| 184 | - string $postfix):?VCalendar { |
|
| 184 | + string $postfix): ?VCalendar { |
|
| 185 | 185 | if (empty($cardData)) { |
| 186 | 186 | return null; |
| 187 | 187 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | return null; |
| 205 | 205 | } |
| 206 | 206 | $birthday = $doc->{$dateField}; |
| 207 | - if (!(string)$birthday) { |
|
| 207 | + if (!(string) $birthday) { |
|
| 208 | 208 | return null; |
| 209 | 209 | } |
| 210 | 210 | // Skip if the BDAY property is not of the right type. |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $unknownYear = false; |
| 223 | 223 | $originalYear = null; |
| 224 | 224 | if (!$dateParts['year']) { |
| 225 | - $birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date']; |
|
| 225 | + $birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date']; |
|
| 226 | 226 | |
| 227 | 227 | $unknownYear = true; |
| 228 | 228 | } else { |
@@ -230,14 +230,14 @@ discard block |
||
| 230 | 230 | if (isset($parameters['X-APPLE-OMIT-YEAR'])) { |
| 231 | 231 | $omitYear = $parameters['X-APPLE-OMIT-YEAR']; |
| 232 | 232 | if ($dateParts['year'] === $omitYear) { |
| 233 | - $birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date']; |
|
| 233 | + $birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date']; |
|
| 234 | 234 | $unknownYear = true; |
| 235 | 235 | } |
| 236 | 236 | } else { |
| 237 | - $originalYear = (int)$dateParts['year']; |
|
| 237 | + $originalYear = (int) $dateParts['year']; |
|
| 238 | 238 | |
| 239 | 239 | if ($originalYear < 1970) { |
| 240 | - $birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date']; |
|
| 240 | + $birthday = '1970-'.$dateParts['month'].'-'.$dateParts['date']; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | ); |
| 273 | 273 | |
| 274 | 274 | $vEvent->DTEND['VALUE'] = 'DATE'; |
| 275 | - $vEvent->{'UID'} = $doc->UID . $postfix; |
|
| 275 | + $vEvent->{'UID'} = $doc->UID.$postfix; |
|
| 276 | 276 | $vEvent->{'RRULE'} = 'FREQ=YEARLY'; |
| 277 | 277 | $vEvent->{'SUMMARY'} = $summary; |
| 278 | 278 | $vEvent->{'TRANSP'} = 'TRANSPARENT'; |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | array $book, |
| 373 | 373 | int $calendarId, |
| 374 | 374 | array $type):void { |
| 375 | - $objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics'; |
|
| 375 | + $objectUri = $book['uri'].'-'.$cardUri.$type['postfix'].'.ics'; |
|
| 376 | 376 | $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix']); |
| 377 | 377 | $existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri); |
| 378 | 378 | if (is_null($calendarData)) { |
@@ -427,28 +427,28 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | private function formatTitle(string $field, |
| 429 | 429 | string $name, |
| 430 | - int $year=null, |
|
| 431 | - bool $supports4Byte=true):string { |
|
| 430 | + int $year = null, |
|
| 431 | + bool $supports4Byte = true):string { |
|
| 432 | 432 | if ($supports4Byte) { |
| 433 | 433 | switch ($field) { |
| 434 | 434 | case 'BDAY': |
| 435 | 435 | return implode('', [ |
| 436 | 436 | ' |