mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Update minor things.
This commit is contained in:
parent
2e6d281bfc
commit
7ee554b48d
@ -45,7 +45,6 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Component\Validator\GroupSequenceProviderInterface;
|
||||
use UnexpectedValueException;
|
||||
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
use const SORT_REGULAR;
|
||||
@ -545,17 +544,17 @@ class AccompanyingPeriod implements
|
||||
public function getAvailablePersonLocation(): Collection
|
||||
{
|
||||
return $this->getOpenParticipations()
|
||||
->filter(static function (AccompanyingPeriodParticipation $p) {
|
||||
return $p->getPerson()->hasCurrentHouseholdAddress();
|
||||
})
|
||||
->map(static function (AccompanyingPeriodParticipation $p) {
|
||||
return $p->getPerson();
|
||||
});
|
||||
->filter(
|
||||
static fn (AccompanyingPeriodParticipation $p): bool => $p->getPerson()->hasCurrentHouseholdAddress()
|
||||
)
|
||||
->map(
|
||||
static fn (AccompanyingPeriodParticipation $p): ?Person => $p->getPerson()
|
||||
);
|
||||
}
|
||||
|
||||
public function getCenter(): ?Center
|
||||
{
|
||||
if (count($this->getPersons()) === 0) {
|
||||
if ($this->getPersons()->count() === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -596,9 +595,11 @@ class AccompanyingPeriod implements
|
||||
*/
|
||||
public function getComments(): Collection
|
||||
{
|
||||
return $this->comments->filter(function (Comment $c) {
|
||||
return $c !== $this->pinnedComment;
|
||||
});
|
||||
return $this
|
||||
->comments
|
||||
->filter(
|
||||
static fn (Comment $c): bool => $c !== $this->pinnedComment
|
||||
);
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?DateTime
|
||||
@ -739,9 +740,7 @@ class AccompanyingPeriod implements
|
||||
return $this
|
||||
->getParticipations()
|
||||
->filter(
|
||||
static function (AccompanyingPeriodParticipation $participation) use ($person): bool {
|
||||
return $participation->getPerson() === $person;
|
||||
}
|
||||
static fn (AccompanyingPeriodParticipation $participation): bool => $participation->getPerson() === $person
|
||||
);
|
||||
}
|
||||
|
||||
@ -763,9 +762,7 @@ class AccompanyingPeriod implements
|
||||
return $this
|
||||
->participations
|
||||
->map(
|
||||
static function (AccompanyingPeriodParticipation $participation): Person {
|
||||
return $participation->getPerson();
|
||||
}
|
||||
static fn (AccompanyingPeriodParticipation $participation): ?Person => $participation->getPerson()
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user