mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
DX: fix cs
This commit is contained in:
@@ -512,7 +512,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
||||
*/
|
||||
public function getUsers(): Collection
|
||||
{
|
||||
return $this->getInvites()->map(static function (Invite $i) { return $i->getUser(); });
|
||||
return $this->getInvites()->map(static function (Invite $i) {
|
||||
return $i->getUser();
|
||||
});
|
||||
}
|
||||
|
||||
public function hasCalendarRange(): bool
|
||||
@@ -597,7 +599,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
||||
}
|
||||
|
||||
$invite = $this->invites
|
||||
->filter(static function (Invite $invite) use ($user) { return $invite->getUser() === $user; })
|
||||
->filter(static function (Invite $invite) use ($user) {
|
||||
return $invite->getUser() === $user;
|
||||
})
|
||||
->first();
|
||||
$this->removeInvite($invite);
|
||||
|
||||
|
@@ -89,10 +89,14 @@ class CalendarToRemoteHandler implements MessageHandlerInterface
|
||||
|
||||
$newInvites = array_filter(
|
||||
array_map(
|
||||
function ($id) { return $this->inviteRepository->find($id); },
|
||||
function ($id) {
|
||||
return $this->inviteRepository->find($id);
|
||||
},
|
||||
$calendarMessage->getNewInvitesIds(),
|
||||
),
|
||||
static function (?Invite $invite) { return null !== $invite; }
|
||||
static function (?Invite $invite) {
|
||||
return null !== $invite;
|
||||
}
|
||||
);
|
||||
|
||||
$this->calendarConnector->syncCalendar(
|
||||
|
@@ -167,7 +167,9 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
||||
]
|
||||
)->toArray();
|
||||
|
||||
$ids = array_map(static function ($item) { return $item['id']; }, $bareEvents['value']);
|
||||
$ids = array_map(static function ($item) {
|
||||
return $item['id'];
|
||||
}, $bareEvents['value']);
|
||||
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
|
||||
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
||||
|
||||
|
@@ -215,7 +215,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface
|
||||
$qb
|
||||
->where(
|
||||
$qb->expr()->orX(
|
||||
// the calendar where the person is the main person:
|
||||
// the calendar where the person is the main person:
|
||||
$qb->expr()->eq('c.person', ':person'),
|
||||
// when the calendar is in a reachable period, and contains person
|
||||
$qb->expr()->andX(
|
||||
|
@@ -96,7 +96,7 @@ final class CalendarTypeTest extends TypeTestCase
|
||||
];
|
||||
|
||||
$calendar = new Calendar();
|
||||
$calendar->setMainUser(new class() extends User {
|
||||
$calendar->setMainUser(new class () extends User {
|
||||
public function getId()
|
||||
{
|
||||
return '1';
|
||||
@@ -114,8 +114,12 @@ final class CalendarTypeTest extends TypeTestCase
|
||||
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
||||
$this->assertEquals(9, $calendar->getLocation()->getId());
|
||||
$this->assertEquals(true, $calendar->getSendSMS());
|
||||
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
||||
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
||||
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) {
|
||||
return $u->getId();
|
||||
}));
|
||||
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) {
|
||||
return $u->getId();
|
||||
}));
|
||||
}
|
||||
|
||||
protected function getExtensions()
|
||||
@@ -147,7 +151,9 @@ final class CalendarTypeTest extends TypeTestCase
|
||||
->will(static function ($args) {
|
||||
return implode(
|
||||
',',
|
||||
array_map(static function ($p) { return $p->getId(); }, $args[0])
|
||||
array_map(static function ($p) {
|
||||
return $p->getId();
|
||||
}, $args[0])
|
||||
);
|
||||
});
|
||||
$transformer->transform(Argument::exact(null))
|
||||
@@ -156,7 +162,9 @@ final class CalendarTypeTest extends TypeTestCase
|
||||
->will(static function ($args) {
|
||||
return implode(
|
||||
',',
|
||||
array_map(static function ($p) { return $p->getId(); }, $args[0]->toArray())
|
||||
array_map(static function ($p) {
|
||||
return $p->getId();
|
||||
}, $args[0]->toArray())
|
||||
);
|
||||
});
|
||||
$transformer->reverseTransform(Argument::type('string'))
|
||||
|
Reference in New Issue
Block a user