Rector changes return typing

This commit is contained in:
2025-08-27 16:32:44 +02:00
parent da240f5ce5
commit 979b2955f6
93 changed files with 164 additions and 180 deletions

View File

@@ -32,7 +32,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
* @ParamConverter("accompanyingPeriodWork", options={"id": "acpw_id"})
*/
#[Route(path: '{_locale}/person/accompanying-period/work/{id}/assign-duplicate', name: 'chill_person_accompanying_period_work_assign_duplicate')]
public function assignDuplicate(AccompanyingPeriodWork $acpw, Request $request)
public function assignDuplicate(AccompanyingPeriodWork $acpw, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$accompanyingPeriod = $acpw->getAccompanyingPeriod();
@@ -79,7 +79,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
* @ParamConverter("acpw2", options={"id": "acpw2_id"})
*/
#[Route(path: '/{_locale}/person/{acpw1_id}/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

@@ -123,7 +123,7 @@ class UserAccompanyingPeriodController extends AbstractController
]);
}
public function buildStatusAndDateFilter(int $filter)
public function buildStatusAndDateFilter(int $filter): \Chill\MainBundle\Templating\Listing\FilterOrderHelper
{
$filterBuilder = $this->filterOrderHelperFactory
->create(self::class)

View File

@@ -60,7 +60,7 @@ abstract class AddressPart extends FunctionNode
*/
abstract public function getPart();
public function getSql(SqlWalker $sqlWalker)
public function getSql(SqlWalker $sqlWalker): string
{
return sprintf(
'get_last_address_%s(%s, %s)',

View File

@@ -215,7 +215,7 @@ class AccompanyingPeriod implements
* @var Collection<int, AccompanyingPeriodParticipation>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: AccompanyingPeriodParticipation::class, cascade: ['persist', 'refresh', 'remove', 'merge', 'detach'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'refresh', 'remove', 'detach'], orphanRemoval: true)]
#[ParticipationOverlap(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED])]
private Collection $participations;

View File

@@ -39,7 +39,7 @@ class Household implements HasCentersInterface
* @var Collection<int, Address>
*/
#[Serializer\Groups(['write'])]
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'detach'])]
#[ORM\JoinTable(name: 'chill_person_household_to_addresses')]
#[ORM\OrderBy(['validFrom' => Criteria::DESC, 'id' => 'DESC'])]
private Collection $addresses;

View File

@@ -85,7 +85,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @var Collection<int, AccompanyingPeriodParticipation>
*/
#[ORM\OneToMany(mappedBy: 'person', targetEntity: AccompanyingPeriodParticipation::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'person', cascade: ['persist', 'remove', 'detach'])]
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
private Collection $accompanyingPeriodParticipations;
@@ -102,7 +102,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @var Collection<int, Address>
*/
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'detach'])]
#[ORM\JoinTable(name: 'chill_person_persons_to_addresses')]
#[ORM\OrderBy(['validFrom' => Criteria::DESC])]
private Collection $addresses;
@@ -110,7 +110,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @var Collection<int, PersonAltName>
*/
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PersonAltName::class, cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)]
private Collection $altNames;
/**
@@ -342,7 +342,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @var Collection<int, PersonPhone>
*/
#[Assert\Valid(traverse: true)]
#[ORM\OneToMany(targetEntity: PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)]
private Collection $otherPhoneNumbers;
/**

View File

@@ -209,7 +209,7 @@ class ListPerson implements ListInterface, GroupedExportInterface
*
* @return CustomField[]
*/
private function getCustomFields()
private function getCustomFields(): mixed
{
return $this->entityManager
->createQuery('SELECT cf '

View File

@@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class FindAccompanyingPeriodWorkType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('acpw', PickLinkedAccompanyingPeriodWorkType::class, [
@@ -33,7 +33,7 @@ class FindAccompanyingPeriodWorkType extends AbstractType
]);
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setRequired('accompanyingPeriod')

View File

@@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PickLinkedAccompanyingPeriodWorkType extends AbstractType
{
public function buildView(FormView $view, FormInterface $form, array $options)
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['multiple'] = $options['multiple'];
$view->vars['types'] = ['acpw'];
@@ -30,7 +30,7 @@ class PickLinkedAccompanyingPeriodWorkType extends AbstractType
$view->vars['attr']['data-accompanying-period-id'] = $options['accompanyingPeriod']->getId();
}
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setRequired('accompanyingPeriod')

View File

@@ -51,7 +51,7 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI
return $this->findOneBy($criteria);
}
public function getActiveClosingMotive(bool $onlyLeaf = true)
public function getActiveClosingMotive(bool $onlyLeaf = true): mixed
{
$rsm = new ResultSetMappingBuilder($this->entityManager);
$rsm->addRootEntityFromClassMetadata($this->repository->getClassName(), 'cm');

View File

@@ -85,7 +85,7 @@ final readonly class HouseholdRepository implements ObjectRepository
return Household::class;
}
private function buildQueryByAccompanyingPeriodParticipation(Person $person, bool $isCount = false, int $limit = 50, int $offset = 0)
private function buildQueryByAccompanyingPeriodParticipation(Person $person, bool $isCount = false, int $limit = 50, int $offset = 0): mixed
{
$rsm = new ResultSetMappingBuilder($this->em);
$rsm->addRootEntityFromClassMetadata(Household::class, 'h');

View File

@@ -78,7 +78,7 @@ class PersonRepository implements ObjectRepository
$firstResult,
$maxResults,
array $only = ['mobile', 'phone'],
) {
): mixed {
$qb = $this->repository->createQueryBuilder('p');
$qb->select('p');

View File

@@ -57,7 +57,7 @@ class SimilarPersonMatcher
float $precision = 0.30,
string $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY,
bool $addYearComparison = false,
) {
): mixed {
$centers = $this->authorizationHelper->getReachableCenters(
$this->tokenStorage->getToken()->getUser(),
PersonVoter::SEE

View File

@@ -713,7 +713,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
self::ensureKernelShutdown();
}
public function testShow404()
public function testShow404(): void
{
$client = $this->getClientAuthenticated();
$client->request(Request::METHOD_GET, sprintf('/api/1.0/person/accompanying-course/%d.json', 99999));

View File

@@ -41,7 +41,7 @@ final class AccompanyingCourseControllerTest extends WebTestCase
self::ensureKernelShutdown();
}
public function testNewWithoutUsers()
public function testNewWithoutUsers(): void
{
$this->client->request('GET', '/fr/person/parcours/new');

View File

@@ -40,7 +40,7 @@ final class HouseholdApiControllerTest extends WebTestCase
/**
* @dataProvider generateHouseholdAssociatedWithAddressReference
*/
public function testFindHouseholdByAddressReference(int $addressReferenceId, int $expectedHouseholdId)
public function testFindHouseholdByAddressReference(int $addressReferenceId, int $expectedHouseholdId): void
{
$client = $this->getClientAuthenticated();
@@ -111,7 +111,7 @@ final class HouseholdApiControllerTest extends WebTestCase
/**
* @dataProvider generateHouseholdId
*/
public function testSuggestAddressByHousehold(int $householdId)
public function testSuggestAddressByHousehold(int $householdId): void
{
$client = $this->getClientAuthenticated();
@@ -158,7 +158,7 @@ final class HouseholdApiControllerTest extends WebTestCase
/**
* @dataProvider generatePersonId
*/
public function testSuggestByAccompanyingPeriodParticipation(int $personId)
public function testSuggestByAccompanyingPeriodParticipation(int $personId): void
{
$client = $this->getClientAuthenticated();

View File

@@ -187,7 +187,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
*
* @group configurable_fields
*/
public function testHiddenFielsAreAbsent()
public function testHiddenFielsAreAbsent(): void
{
$crawler = $this->client->request('GET', $this->editUrl);

View File

@@ -43,7 +43,7 @@ final class RelationshipApiControllerTest extends WebTestCase
/**
* @dataProvider personProvider
*/
public function testGetRelationshipByPerson(int $personId)
public function testGetRelationshipByPerson(int $personId): void
{
self::ensureKernelShutdown();
$client = $this->getClientAuthenticated();

View File

@@ -28,7 +28,7 @@ final class MaxHolderValidatorTest extends ConstraintValidatorTestCase
/**
* @dataProvider provideInvalidHousehold
*/
public function testHouseholdInvalid(Household $household, mixed $parameters)
public function testHouseholdInvalid(Household $household, mixed $parameters): void
{
$constraint = $this->getConstraint();
@@ -73,7 +73,7 @@ final class MaxHolderValidatorTest extends ConstraintValidatorTestCase
];
}
protected function createValidator()
protected function createValidator(): \Symfony\Component\Validator\ConstraintValidatorInterface
{
return new MaxHolderValidator();
}