mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: fix cs
This commit is contained in:
parent
4b2c330d22
commit
70871176fc
@ -58,7 +58,8 @@ class DateAggregator implements AggregatorInterface
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year':
|
case 'year':
|
||||||
$fmt = 'YYYY'; $order = 'DESC';
|
$fmt = 'YYYY';
|
||||||
|
$order = 'DESC';
|
||||||
|
|
||||||
break; // order DESC does not works !
|
break; // order DESC does not works !
|
||||||
|
|
||||||
|
@ -53,6 +53,11 @@ class ResourceKindRepository implements ObjectRepository
|
|||||||
->getResult();
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findOneByKind(string $kind): ?ResourceKind
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy(['kind' => $kind]) ;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ResourceType[]
|
* @return ResourceType[]
|
||||||
*/
|
*/
|
||||||
|
@ -512,7 +512,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
*/
|
*/
|
||||||
public function getUsers(): Collection
|
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
|
public function hasCalendarRange(): bool
|
||||||
@ -597,7 +599,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
}
|
}
|
||||||
|
|
||||||
$invite = $this->invites
|
$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();
|
->first();
|
||||||
$this->removeInvite($invite);
|
$this->removeInvite($invite);
|
||||||
|
|
||||||
|
@ -89,10 +89,14 @@ class CalendarToRemoteHandler implements MessageHandlerInterface
|
|||||||
|
|
||||||
$newInvites = array_filter(
|
$newInvites = array_filter(
|
||||||
array_map(
|
array_map(
|
||||||
function ($id) { return $this->inviteRepository->find($id); },
|
function ($id) {
|
||||||
|
return $this->inviteRepository->find($id);
|
||||||
|
},
|
||||||
$calendarMessage->getNewInvitesIds(),
|
$calendarMessage->getNewInvitesIds(),
|
||||||
),
|
),
|
||||||
static function (?Invite $invite) { return null !== $invite; }
|
static function (?Invite $invite) {
|
||||||
|
return null !== $invite;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->calendarConnector->syncCalendar(
|
$this->calendarConnector->syncCalendar(
|
||||||
|
@ -167,7 +167,9 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
]
|
]
|
||||||
)->toArray();
|
)->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);
|
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
|
||||||
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
||||||
|
|
||||||
|
@ -114,8 +114,12 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
||||||
$this->assertEquals(9, $calendar->getLocation()->getId());
|
$this->assertEquals(9, $calendar->getLocation()->getId());
|
||||||
$this->assertEquals(true, $calendar->getSendSMS());
|
$this->assertEquals(true, $calendar->getSendSMS());
|
||||||
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) {
|
||||||
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
return $u->getId();
|
||||||
|
}));
|
||||||
|
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) {
|
||||||
|
return $u->getId();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getExtensions()
|
protected function getExtensions()
|
||||||
@ -147,7 +151,9 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
->will(static function ($args) {
|
->will(static function ($args) {
|
||||||
return implode(
|
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))
|
$transformer->transform(Argument::exact(null))
|
||||||
@ -156,7 +162,9 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
->will(static function ($args) {
|
->will(static function ($args) {
|
||||||
return implode(
|
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'))
|
$transformer->reverseTransform(Argument::type('string'))
|
||||||
|
@ -42,7 +42,9 @@ class IdToEntityDataTransformer implements DataTransformerInterface
|
|||||||
{
|
{
|
||||||
$this->repository = $repository;
|
$this->repository = $repository;
|
||||||
$this->multiple = $multiple;
|
$this->multiple = $multiple;
|
||||||
$this->getId = $getId ?? static function (object $o) { return $o->getId(); };
|
$this->getId = $getId ?? static function (object $o) {
|
||||||
|
return $o->getId();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user