mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -121,9 +121,7 @@ class RemoteEventConverter
|
||||
'subject' => '[Chill] ' .
|
||||
implode(
|
||||
', ',
|
||||
$calendar->getPersons()->map(function (Person $p) {
|
||||
return $this->personRender->renderString($p, []);
|
||||
})->toArray()
|
||||
$calendar->getPersons()->map(fn(Person $p) => $this->personRender->renderString($p, []))->toArray()
|
||||
),
|
||||
'start' => [
|
||||
'dateTime' => $calendar->getStartDate()->setTimezone($this->remoteDateTimeZone)
|
||||
@@ -161,9 +159,7 @@ class RemoteEventConverter
|
||||
{
|
||||
return [
|
||||
'attendees' => $calendar->getInvites()->map(
|
||||
function (Invite $i) {
|
||||
return $this->buildInviteToAttendee($i);
|
||||
}
|
||||
fn(Invite $i) => $this->buildInviteToAttendee($i)
|
||||
)->toArray(),
|
||||
];
|
||||
}
|
||||
|
@@ -190,23 +190,17 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
||||
]
|
||||
)->toArray();
|
||||
|
||||
$ids = array_map(static function ($item) {
|
||||
return $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(
|
||||
function ($item) {
|
||||
return $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 function ($item) use ($existingIdsInRange, $existingIdsInCalendar) {
|
||||
return ((!$existingIdsInRange[$item['id']]) ?? true) && ((!$existingIdsInCalendar[$item['id']]) ?? true);
|
||||
}
|
||||
static fn($item) => ((!$existingIdsInRange[$item['id']]) ?? true) && ((!$existingIdsInCalendar[$item['id']]) ?? true)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -601,9 +595,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
||||
}
|
||||
|
||||
$this->cacheScheduleTimeForUser[$userId] = array_map(
|
||||
function ($item) {
|
||||
return $this->remoteEventConverter->convertAvailabilityToRemoteEvent($item);
|
||||
},
|
||||
fn($item) => $this->remoteEventConverter->convertAvailabilityToRemoteEvent($item),
|
||||
$response['value'][0]['scheduleItems']
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user