calDavBackend->getCalendarsForUser($principalUri) ?? []; if (!empty($calendarUris)) { $calendarInfos = array_filter($calendarInfos, function ($calendar) use ($calendarUris) { return in_array($calendar['uri'], $calendarUris); }); } $iCalendars = []; foreach ($calendarInfos as $calendarInfo) { $calendar = new Calendar($this->calDavBackend, $calendarInfo, $this->l10n, $this->config, $this->logger); $iCalendars[] = new CalendarImpl( $calendar, $calendarInfo, $this->calDavBackend, ); } return $iCalendars; } }