DX: fix cs

This commit is contained in:
2023-04-15 00:43:55 +02:00
parent 80647147ee
commit 746ed4f5e5
188 changed files with 309 additions and 308 deletions

View File

@@ -121,7 +121,7 @@ class RemoteEventConverter
'subject' => '[Chill] ' .
implode(
', ',
$calendar->getPersons()->map(fn(Person $p) => $this->personRender->renderString($p, []))->toArray()
$calendar->getPersons()->map(fn (Person $p) => $this->personRender->renderString($p, []))->toArray()
),
'start' => [
'dateTime' => $calendar->getStartDate()->setTimezone($this->remoteDateTimeZone)
@@ -159,7 +159,7 @@ class RemoteEventConverter
{
return [
'attendees' => $calendar->getInvites()->map(
fn(Invite $i) => $this->buildInviteToAttendee($i)
fn (Invite $i) => $this->buildInviteToAttendee($i)
)->toArray(),
];
}

View File

@@ -190,17 +190,17 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
]
)->toArray();
$ids = array_map(static fn($item) => $item['id'], $bareEvents['value']);
$ids = array_map(static fn ($item) => $item['id'], $bareEvents['value']);
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
return array_values(
array_map(
fn($item) => $this->remoteEventConverter->convertToRemote($item),
fn ($item) => $this->remoteEventConverter->convertToRemote($item),
// filter all event to keep only the one not in range
array_filter(
$bareEvents['value'],
static fn($item) => ((!$existingIdsInRange[$item['id']]) ?? true) && ((!$existingIdsInCalendar[$item['id']]) ?? true)
static fn ($item) => ((!$existingIdsInRange[$item['id']]) ?? true) && ((!$existingIdsInCalendar[$item['id']]) ?? true)
)
)
);
@@ -595,7 +595,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
}
$this->cacheScheduleTimeForUser[$userId] = array_map(
fn($item) => $this->remoteEventConverter->convertAvailabilityToRemoteEvent($item),
fn ($item) => $this->remoteEventConverter->convertAvailabilityToRemoteEvent($item),
$response['value'][0]['scheduleItems']
);