@@ -63,7 +63,7 @@ |
||
63 | 63 | public function findAll(?int $limit = null, ?int $offset = null): DataResponse { |
64 | 64 | $allStatuses = $this->service->findAll($limit, $offset); |
65 | 65 | |
66 | - return new DataResponse(array_map(function ($userStatus) { |
|
66 | + return new DataResponse(array_map(function($userStatus) { |
|
67 | 67 | return $this->formatStatus($userStatus); |
68 | 68 | }, $allStatuses)); |
69 | 69 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | return SearchResult::complete($this->getName(), []); |
94 | 94 | } |
95 | 95 | |
96 | - $principalUri = 'principals/users/' . $user->getUID(); |
|
96 | + $principalUri = 'principals/users/'.$user->getUID(); |
|
97 | 97 | $calendarsById = $this->getSortedCalendars($principalUri); |
98 | 98 | $subscriptionsById = $this->getSortedSubscriptions($principalUri); |
99 | 99 | |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | 'offset' => $query->getCursor(), |
109 | 109 | ] |
110 | 110 | ); |
111 | - $formattedResults = \array_map(function (array $taskRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { |
|
111 | + $formattedResults = \array_map(function(array $taskRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { |
|
112 | 112 | $component = $this->getPrimaryComponent($taskRow['calendardata'], self::$componentType); |
113 | - $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled task')); |
|
113 | + $title = (string) ($component->SUMMARY ?? $this->l10n->t('Untitled task')); |
|
114 | 114 | $subline = $this->generateSubline($component); |
115 | 115 | |
116 | 116 | if ($taskRow['calendartype'] === CalDavBackend::CALENDAR_TYPE_CALENDAR) { |
@@ -78,7 +78,7 @@ |
||
78 | 78 | // The folder has to be more than a day old |
79 | 79 | $initial = $uploadFolder->getMTime() < $time; |
80 | 80 | |
81 | - $expire = array_reduce($files, function (bool $carry, File $file) use ($time) { |
|
81 | + $expire = array_reduce($files, function(bool $carry, File $file) use ($time) { |
|
82 | 82 | return $carry && $file->getMTime() < $time; |
83 | 83 | }, $initial); |
84 | 84 |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'privilege' => '{DAV:}read', |
111 | 111 | 'principal' => $this->getOwner(), |
112 | 112 | 'protected' => true, |
113 | - ],[ |
|
113 | + ], [ |
|
114 | 114 | 'privilege' => '{DAV:}write', |
115 | 115 | 'principal' => $this->getOwner(), |
116 | 116 | 'protected' => true, |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | $acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl); |
148 | 148 | $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system']; |
149 | - return array_filter($acl, function ($rule) use ($allowedPrincipals) { |
|
149 | + return array_filter($acl, function($rule) use ($allowedPrincipals) { |
|
150 | 150 | return \in_array($rule['principal'], $allowedPrincipals, true); |
151 | 151 | }); |
152 | 152 | } |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | |
181 | 181 | public function delete() { |
182 | 182 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
183 | - $principal = 'principal:' . parent::getOwner(); |
|
183 | + $principal = 'principal:'.parent::getOwner(); |
|
184 | 184 | $shares = $this->carddavBackend->getShares($this->getResourceId()); |
185 | - $shares = array_filter($shares, function ($share) use ($principal) { |
|
185 | + $shares = array_filter($shares, function($share) use ($principal) { |
|
186 | 186 | return $share['href'] === $principal; |
187 | 187 | }); |
188 | 188 | if (empty($shares)) { |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | /** @var string|null */ |
67 | 67 | private $pathOfCalendarObjectChange = null; |
68 | 68 | |
69 | - public const CALENDAR_USER_TYPE = '{' . self::NS_CALDAV . '}calendar-user-type'; |
|
70 | - public const SCHEDULE_DEFAULT_CALENDAR_URL = '{' . Plugin::NS_CALDAV . '}schedule-default-calendar-URL'; |
|
69 | + public const CALENDAR_USER_TYPE = '{'.self::NS_CALDAV.'}calendar-user-type'; |
|
70 | + public const SCHEDULE_DEFAULT_CALENDAR_URL = '{'.Plugin::NS_CALDAV.'}schedule-default-calendar-URL'; |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * @param IConfig $config |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public function propFind(PropFind $propFind, INode $node) { |
102 | 102 | if ($node instanceof IPrincipal) { |
103 | 103 | // overwrite Sabre/Dav's implementation |
104 | - $propFind->handle(self::CALENDAR_USER_TYPE, function () use ($node) { |
|
104 | + $propFind->handle(self::CALENDAR_USER_TYPE, function() use ($node) { |
|
105 | 105 | if ($node instanceof IProperties) { |
106 | 106 | $props = $node->getProperties([self::CALENDAR_USER_TYPE]); |
107 | 107 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | public function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) { |
282 | 282 | if ($node instanceof IPrincipal) { |
283 | - $propFind->handle(self::SCHEDULE_DEFAULT_CALENDAR_URL, function () use ($node) { |
|
283 | + $propFind->handle(self::SCHEDULE_DEFAULT_CALENDAR_URL, function() use ($node) { |
|
284 | 284 | /** @var \OCA\DAV\CalDAV\Plugin $caldavPlugin */ |
285 | 285 | $caldavPlugin = $this->server->getPlugin('caldav'); |
286 | 286 | $principalUrl = $node->getPrincipalUrl(); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | ]); |
313 | 313 | } |
314 | 314 | |
315 | - $result = $this->server->getPropertiesForPath($calendarHomePath . '/' . $uri, [], 1); |
|
315 | + $result = $this->server->getPropertiesForPath($calendarHomePath.'/'.$uri, [], 1); |
|
316 | 316 | if (empty($result)) { |
317 | 317 | return null; |
318 | 318 | } |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | * @param string $principal |
329 | 329 | * @return string|null |
330 | 330 | */ |
331 | - protected function getCalendarUserTypeForPrincipal($principal):?string { |
|
332 | - $calendarUserType = '{' . self::NS_CALDAV . '}calendar-user-type'; |
|
331 | + protected function getCalendarUserTypeForPrincipal($principal): ?string { |
|
332 | + $calendarUserType = '{'.self::NS_CALDAV.'}calendar-user-type'; |
|
333 | 333 | $properties = $this->server->getProperties( |
334 | 334 | $principal, |
335 | 335 | [$calendarUserType] |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | * @param ITip\Message $iTipMessage |
348 | 348 | * @return null|Property |
349 | 349 | */ |
350 | - private function getCurrentAttendee(ITip\Message $iTipMessage):?Property { |
|
350 | + private function getCurrentAttendee(ITip\Message $iTipMessage): ?Property { |
|
351 | 351 | /** @var VEvent $vevent */ |
352 | 352 | $vevent = $iTipMessage->message->VEVENT; |
353 | 353 | $attendees = $vevent->select('ATTENDEE'); |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | ['{http://sabredav.org/ns}email-address' => $this->stripOffMailTo($email)], |
426 | 426 | [ |
427 | 427 | '{DAV:}principal-URL', |
428 | - '{' . self::NS_CALDAV . '}calendar-home-set', |
|
429 | - '{' . self::NS_CALDAV . '}schedule-inbox-URL', |
|
428 | + '{'.self::NS_CALDAV.'}calendar-home-set', |
|
429 | + '{'.self::NS_CALDAV.'}schedule-inbox-URL', |
|
430 | 430 | '{http://sabredav.org/ns}email-address', |
431 | 431 | |
432 | 432 | ] |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $objects = []; |
439 | 439 | $calendarTimeZone = new DateTimeZone('UTC'); |
440 | 440 | |
441 | - $homePath = $result[0][200]['{' . self::NS_CALDAV . '}calendar-home-set']->getHref(); |
|
441 | + $homePath = $result[0][200]['{'.self::NS_CALDAV.'}calendar-home-set']->getHref(); |
|
442 | 442 | foreach ($this->server->tree->getNodeForPath($homePath)->getChildren() as $node) { |
443 | 443 | if (!$node instanceof ICalendar) { |
444 | 444 | continue; |
@@ -489,8 +489,8 @@ discard block |
||
489 | 489 | } |
490 | 490 | |
491 | 491 | $inboxProps = $this->server->getProperties( |
492 | - $result[0][200]['{' . self::NS_CALDAV . '}schedule-inbox-URL']->getHref(), |
|
493 | - ['{' . self::NS_CALDAV . '}calendar-availability'] |
|
492 | + $result[0][200]['{'.self::NS_CALDAV.'}schedule-inbox-URL']->getHref(), |
|
493 | + ['{'.self::NS_CALDAV.'}calendar-availability'] |
|
494 | 494 | ); |
495 | 495 | |
496 | 496 | $vcalendar = new VCalendar(); |
@@ -502,10 +502,10 @@ discard block |
||
502 | 502 | $generator->setBaseObject($vcalendar); |
503 | 503 | $generator->setTimeZone($calendarTimeZone); |
504 | 504 | |
505 | - if (isset($inboxProps['{' . self::NS_CALDAV . '}calendar-availability'])) { |
|
505 | + if (isset($inboxProps['{'.self::NS_CALDAV.'}calendar-availability'])) { |
|
506 | 506 | $generator->setVAvailability( |
507 | 507 | Reader::read( |
508 | - $inboxProps['{' . self::NS_CALDAV . '}calendar-availability'] |
|
508 | + $inboxProps['{'.self::NS_CALDAV.'}calendar-availability'] |
|
509 | 509 | ) |
510 | 510 | ); |
511 | 511 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | // $calendarHomePath will look like: calendars/username |
106 | - $calendarHomePath = $pathParts[0] . '/' . $pathParts[1]; |
|
106 | + $calendarHomePath = $pathParts[0].'/'.$pathParts[1]; |
|
107 | 107 | try { |
108 | 108 | $calendarHome = $this->server->tree->getNodeForPath($calendarHomePath); |
109 | 109 | if (!($calendarHome instanceof CalendarHome)) { |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | ], |
147 | 147 | [ |
148 | 148 | 'privilege' => '{DAV:}read', |
149 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
149 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
150 | 150 | 'protected' => true, |
151 | 151 | ], |
152 | 152 | [ |
153 | 153 | 'privilege' => '{DAV:}read', |
154 | - 'principal' => $this->getOwner() . '/calendar-proxy-read', |
|
154 | + 'principal' => $this->getOwner().'/calendar-proxy-read', |
|
155 | 155 | 'protected' => true, |
156 | 156 | ], |
157 | 157 | ]; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | ]; |
165 | 165 | $acl[] = [ |
166 | 166 | 'privilege' => '{DAV:}write', |
167 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
167 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
168 | 168 | 'protected' => true, |
169 | 169 | ]; |
170 | 170 | } else { |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | ]; |
176 | 176 | $acl[] = [ |
177 | 177 | 'privilege' => '{DAV:}write-properties', |
178 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
178 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
179 | 179 | 'protected' => true, |
180 | 180 | ]; |
181 | 181 | } |
182 | 182 | |
183 | 183 | $acl[] = [ |
184 | 184 | 'privilege' => '{DAV:}write-properties', |
185 | - 'principal' => $this->getOwner() . '/calendar-proxy-read', |
|
185 | + 'principal' => $this->getOwner().'/calendar-proxy-read', |
|
186 | 186 | 'protected' => true, |
187 | 187 | ]; |
188 | 188 | |
@@ -221,12 +221,12 @@ discard block |
||
221 | 221 | $acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); |
222 | 222 | $allowedPrincipals = [ |
223 | 223 | $this->getOwner(), |
224 | - $this->getOwner(). '/calendar-proxy-read', |
|
225 | - $this->getOwner(). '/calendar-proxy-write', |
|
224 | + $this->getOwner().'/calendar-proxy-read', |
|
225 | + $this->getOwner().'/calendar-proxy-write', |
|
226 | 226 | parent::getOwner(), |
227 | 227 | 'principals/system/public' |
228 | 228 | ]; |
229 | - return array_filter($acl, function ($rule) use ($allowedPrincipals) { |
|
229 | + return array_filter($acl, function($rule) use ($allowedPrincipals) { |
|
230 | 230 | return \in_array($rule['principal'], $allowedPrincipals, true); |
231 | 231 | }); |
232 | 232 | } |
@@ -245,9 +245,9 @@ discard block |
||
245 | 245 | public function delete() { |
246 | 246 | if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) && |
247 | 247 | $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) { |
248 | - $principal = 'principal:' . parent::getOwner(); |
|
248 | + $principal = 'principal:'.parent::getOwner(); |
|
249 | 249 | $shares = $this->caldavBackend->getShares($this->getResourceId()); |
250 | - $shares = array_filter($shares, function ($share) use ($principal) { |
|
250 | + $shares = array_filter($shares, function($share) use ($principal) { |
|
251 | 251 | return $share['href'] === $principal; |
252 | 252 | }); |
253 | 253 | if (empty($shares)) { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | public function calendarQuery(array $filters) { |
338 | 338 | $uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters); |
339 | 339 | if ($this->isShared()) { |
340 | - return array_filter($uris, function ($uri) { |
|
340 | + return array_filter($uris, function($uri) { |
|
341 | 341 | return $this->childExists($uri); |
342 | 342 | }); |
343 | 343 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param VEvent $vevent |
141 | 141 | */ |
142 | 142 | private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n, VEvent $vevent):void { |
143 | - $template->setSubject('Notification: ' . $this->getTitleFromVEvent($vevent, $l10n)); |
|
143 | + $template->setSubject('Notification: '.$this->getTitleFromVEvent($vevent, $l10n)); |
|
144 | 144 | $template->addHeading($this->getTitleFromVEvent($vevent, $l10n)); |
145 | 145 | } |
146 | 146 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @param VEvent $vevent |
185 | 185 | * @return array|null |
186 | 186 | */ |
187 | - private function getOrganizerEMailAndNameFromEvent(VEvent $vevent):?array { |
|
187 | + private function getOrganizerEMailAndNameFromEvent(VEvent $vevent): ?array { |
|
188 | 188 | if (!$vevent->ORGANIZER) { |
189 | 189 | return null; |
190 | 190 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * @param VObject\Property $attendee |
332 | 332 | * @return string|null |
333 | 333 | */ |
334 | - private function getEMailAddressOfAttendee(VObject\Property $attendee):?string { |
|
334 | + private function getEMailAddressOfAttendee(VObject\Property $attendee): ?string { |
|
335 | 335 | if (!$this->hasAttendeeMailURI($attendee)) { |
336 | 336 | return null; |
337 | 337 | } |
@@ -415,10 +415,10 @@ discard block |
||
415 | 415 | ]); |
416 | 416 | |
417 | 417 | return $localeStart |
418 | - . ' (' . $startTimezone . ') ' |
|
418 | + . ' ('.$startTimezone.') ' |
|
419 | 419 | . ' - ' |
420 | 420 | . $localeEnd |
421 | - . ' (' . $endTimezone . ')'; |
|
421 | + . ' ('.$endTimezone.')'; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | // Show only the time if the day is the same |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | return $localeStart |
433 | 433 | . ' - ' |
434 | 434 | . $localeEnd |
435 | - . ' (' . $startTimezone . ')'; |
|
435 | + . ' ('.$startTimezone.')'; |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | /** |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | */ |
489 | 489 | private function getTitleFromVEvent(VEvent $vevent, IL10N $l10n):string { |
490 | 490 | if (isset($vevent->SUMMARY)) { |
491 | - return (string)$vevent->SUMMARY; |
|
491 | + return (string) $vevent->SUMMARY; |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | return $l10n->t('Untitled event'); |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | */ |
597 | 597 | private function getVEventByRecurrenceId(VObject\Component\VCalendar $vcalendar, |
598 | 598 | int $recurrenceId, |
599 | - bool $isRecurrenceException):?VEvent { |
|
599 | + bool $isRecurrenceException): ?VEvent { |
|
600 | 600 | $vevents = $this->getAllVEventsFromVCalendar($vcalendar); |
601 | 601 | if (count($vevents) === 0) { |
602 | 602 | return null; |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | * @param string $calendarData |
675 | 675 | * @return VObject\Component\VCalendar|null |
676 | 676 | */ |
677 | - private function parseCalendarData(string $calendarData):?VObject\Component\VCalendar { |
|
677 | + private function parseCalendarData(string $calendarData): ?VObject\Component\VCalendar { |
|
678 | 678 | try { |
679 | 679 | return VObject\Reader::read($calendarData, |
680 | 680 | VObject\Reader::OPTION_FORGIVING); |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | * @param string $principalUri |
688 | 688 | * @return IUser|null |
689 | 689 | */ |
690 | - private function getUserFromPrincipalURI(string $principalUri):?IUser { |
|
690 | + private function getUserFromPrincipalURI(string $principalUri): ?IUser { |
|
691 | 691 | if (!$principalUri) { |
692 | 692 | return null; |
693 | 693 | } |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | * @return VObject\Component\VEvent[] |
728 | 728 | */ |
729 | 729 | private function getRecurrenceExceptionFromListOfVEvents(array $vevents):array { |
730 | - return array_values(array_filter($vevents, function (VEvent $vevent) { |
|
730 | + return array_values(array_filter($vevents, function(VEvent $vevent) { |
|
731 | 731 | return $vevent->{'RECURRENCE-ID'} !== null; |
732 | 732 | })); |
733 | 733 | } |
@@ -736,8 +736,8 @@ discard block |
||
736 | 736 | * @param array $vevents |
737 | 737 | * @return VEvent|null |
738 | 738 | */ |
739 | - private function getMasterItemFromListOfVEvents(array $vevents):?VEvent { |
|
740 | - $elements = array_values(array_filter($vevents, function (VEvent $vevent) { |
|
739 | + private function getMasterItemFromListOfVEvents(array $vevents): ?VEvent { |
|
740 | + $elements = array_values(array_filter($vevents, function(VEvent $vevent) { |
|
741 | 741 | return $vevent->{'RECURRENCE-ID'} === null; |
742 | 742 | })); |
743 | 743 |