mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -113,9 +113,7 @@ class ParticipationController extends AbstractController
|
||||
[
|
||||
'event_id' => current($participations)->getEvent()->getId(),
|
||||
'persons_ids' => implode(',', array_map(
|
||||
static function (Participation $p) {
|
||||
return $p->getPerson()->getId();
|
||||
},
|
||||
static fn(Participation $p) => $p->getPerson()->getId(),
|
||||
$participations
|
||||
)),
|
||||
]
|
||||
@@ -649,19 +647,14 @@ class ParticipationController extends AbstractController
|
||||
|
||||
// create a collection of person's id participating to the event
|
||||
/** @var \Doctrine\Common\Collections\ArrayCollection $peopleParticipating */
|
||||
$peopleParticipating = $peopleParticipating ??
|
||||
$participation->getEvent()->getParticipations()->map(
|
||||
static function (Participation $p) {
|
||||
return $p->getPerson()->getId();
|
||||
}
|
||||
);
|
||||
$peopleParticipating ??= $participation->getEvent()->getParticipations()->map(
|
||||
static fn(Participation $p) => $p->getPerson()->getId()
|
||||
);
|
||||
// check that the user is not already in the event
|
||||
if ($peopleParticipating->contains($participation->getPerson()->getId())) {
|
||||
$ignoredParticipations[] = $participation
|
||||
->getEvent()->getParticipations()->filter(
|
||||
static function (Participation $p) use ($participation) {
|
||||
return $p->getPerson()->getId() === $participation->getPerson()->getId();
|
||||
}
|
||||
static fn(Participation $p) => $p->getPerson()->getId() === $participation->getPerson()->getId()
|
||||
)->first();
|
||||
} else {
|
||||
$newParticipations[] = $participation;
|
||||
|
Reference in New Issue
Block a user