Rector php82 changes

This commit is contained in:
2025-10-02 16:19:16 +02:00
parent f2922018ce
commit 4a08de09b8
18 changed files with 30 additions and 36 deletions

View File

@@ -113,11 +113,11 @@ class PersonMove
$conditions = [];
if (array_key_exists('joinTable', $mapping)) {
if (property_exists($mapping, 'joinTable')) {
foreach ($mapping['joinTable']['joinColumns'] as $columns) {
$conditions[] = sprintf('%s = %d', $columns['referencedColumnName'], $from->getId());
}
} elseif (array_key_exists('joinColumns', $mapping)) {
} elseif (property_exists($mapping, 'joinColumns')) {
foreach ($mapping['joinColumns'] as $columns) {
$conditions[] = sprintf('%s = %d', $columns['name'], $from->getId());
}

View File

@@ -79,7 +79,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
* @ParamConverter("acpw2", options={"id": "acpw2_id"})
*/
#[Route(path: '/{_locale}/person/{acpw1_id}/acpw-duplicate/{acpw2_id}/confirm', name: 'chill_person_acpw_duplicate_confirm')]
public function confirmAction(AccompanyingPeriodWork $acpw1, AccompanyingPeriodWork $acpw2, Request $request)
public function confirmAction(AccompanyingPeriodWork $acpw1, AccompanyingPeriodWork $acpw2, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$accompanyingPeriod = $acpw1->getAccompanyingPeriod();

View File

@@ -44,7 +44,7 @@ final readonly class PersonEditController
* @ParamConverter("person", options={"id": "person_id"})
*/
#[Route(path: '/{_locale}/person/{person_id}/general/edit', name: 'chill_person_general_edit')]
public function editAction(Person $person, Request $request, Session $session)
public function editAction(Person $person, Request $request, Session $session): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
if (!$this->security->isGranted(PersonVoter::UPDATE, $person)) {
throw new AccessDeniedHttpException('You are not allowed to edit this person.');

View File

@@ -50,7 +50,7 @@ final readonly class HouseholdRepository implements ObjectRepository
$this->em = $entityManager;
}
public function countByAccompanyingPeriodParticipation(Person $person)
public function countByAccompanyingPeriodParticipation(Person $person): mixed
{
return $this->buildQueryByAccompanyingPeriodParticipation($person, true);
}
@@ -70,7 +70,7 @@ final readonly class HouseholdRepository implements ObjectRepository
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findByAccompanyingPeriodParticipation(Person $person, int $limit, int $offset)
public function findByAccompanyingPeriodParticipation(Person $person, int $limit, int $offset): mixed
{
return $this->buildQueryByAccompanyingPeriodParticipation($person, false, $limit, $offset);
}

View File

@@ -44,7 +44,7 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T
$entity = $this->generateClass($period, $socialIssues);
$consistency = new AccompanyingPeriodSocialIssueConsistencyEntityListener();
$consistency->prePersist($entity, $this->generateLifecycleArgs($period, Step::PrePersist));
$consistency->prePersist($entity);
$this->assertCount(2, $period->getSocialIssues());
$this->assertContains($grandGrandChild, $period->getSocialIssues());
@@ -69,7 +69,7 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T
$period->addSocialIssue($issue);
}
$consistency->prePersistAccompanyingPeriod($period, $this->generateLifecycleArgs($period, Step::PrePersist));
$consistency->prePersistAccompanyingPeriod($period);
$this->assertCount(1, $period->getSocialIssues());
$this->assertSame($grandGrandChild, $period->getSocialIssues()->first());
@@ -87,7 +87,7 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T
$entity = $this->generateClass($period, $socialIssues);
$consistency = new AccompanyingPeriodSocialIssueConsistencyEntityListener();
$consistency->preUpdate($entity, $this->generateLifecycleArgs($period, Step::PreUpdate));
$consistency->preUpdate($entity);
$this->assertCount(2, $period->getSocialIssues());
$this->assertContains($grandGrandChild, $period->getSocialIssues());
@@ -112,7 +112,7 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T
$period->addSocialIssue($issue);
}
$consistency->prePersistAccompanyingPeriod($period, $this->generateLifecycleArgs($period, Step::PrePersist));
$consistency->prePersistAccompanyingPeriod($period);
$this->assertCount(1, $period->getSocialIssues());
$this->assertSame($grandGrandChild, $period->getSocialIssues()->first());