diff --git a/rector.php b/rector.php index 6933c0e6d..c972ac2d8 100644 --- a/rector.php +++ b/rector.php @@ -17,17 +17,17 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ - __DIR__ . '/docs', - __DIR__ . '/src', - __DIR__ . '/rector.php', + __DIR__.'/docs', + __DIR__.'/src', + __DIR__.'/rector.php', ]); $rectorConfig->skip([ Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class => __DIR__.'src/Bundle/ChillMainBundle/Service/Notifier/LegacyOvhCloudFactory.php', ]); - //$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/test/App_KernelTestDebugContainer.xml '); - //$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php'); + // $rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/test/App_KernelTestDebugContainer.xml '); + // $rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php'); // $rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class); // $rectorConfig->cacheDirectory(__DIR__ . '/.cache/rector'); @@ -45,21 +45,24 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector::class); // part of the symfony 54 rules - $rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class); - $rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class); - //$rectorConfig->disableParallel(); + $rectorConfig->rule(Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class); + $rectorConfig->rule(Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class); + // $rectorConfig->disableParallel(); // define sets of rules $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_82, - Rector\Symfony\Set\SymfonySetList::SYMFONY_60, - Rector\Symfony\Set\SymfonySetList::SYMFONY_61, - Rector\Symfony\Set\SymfonySetList::SYMFONY_62, - Rector\Symfony\Set\SymfonySetList::SYMFONY_63, - Rector\Symfony\Set\SymfonySetList::SYMFONY_64, - Rector\Symfony\Set\SymfonySetList::SYMFONY_70, - Rector\Symfony\Set\SymfonySetList::SYMFONY_71, -// Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, +// LevelSetList::UP_TO_PHP_82, +// SymfonySetList::SYMFONY_60, +// SymfonySetList::SYMFONY_61, +// SymfonySetList::SYMFONY_62, +// SymfonySetList::SYMFONY_63, +// SymfonySetList::SYMFONY_64, +// SymfonySetList::SYMFONY_70, +// SymfonySetList::SYMFONY_71, + Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_ORM_29, + Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_DBAL_30, + Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, + Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, ]); $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php index 470d84757..62a9473bb 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php @@ -25,7 +25,7 @@ final class ActivityControllerTest extends WebTestCase /** * @dataProvider getSecuredPagesUnauthenticated */ - public function testAccessIsDeniedForUnauthenticated(mixed $url) + public function testAccessIsDeniedForUnauthenticated(mixed $url): void { $client = $this->createClient(); @@ -101,7 +101,7 @@ final class ActivityControllerTest extends WebTestCase ]; } - public function testCompleteScenario() + public function testCompleteScenario(): void { // Create a new client to browse the application $client = $this->getAuthenticatedClient(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php index e4cae588c..854a72e9b 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php @@ -57,7 +57,7 @@ final class ActivityVoterTest extends KernelTestCase $this->prophet = new \Prophecy\Prophet(); } - public function testNullUser() + public function testNullUser(): void { $token = $this->prepareToken(); $center = $this->prepareCenter(1, 'center'); @@ -86,7 +86,7 @@ final class ActivityVoterTest extends KernelTestCase Center $center, $attribute, $message, - ) { + ): void { $token = $this->prepareToken($user); $activity = $this->prepareActivity($scope, $this->preparePerson($center)); diff --git a/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php b/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php index ee74e313b..6914ba256 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php @@ -33,7 +33,7 @@ final class AsideActivityControllerTest extends WebTestCase /** * @dataProvider generateAsideActivityId */ - public function testEditWithoutUsers(int $asideActivityId) + public function testEditWithoutUsers(int $asideActivityId): void { self::ensureKernelShutdown(); $client = $this->getClientAuthenticated(); diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php index 3154a772d..fdc795896 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php @@ -45,7 +45,7 @@ class ChargeRepository extends ServiceEntityRepository return $qb->getQuery()->getResult(); } - public function findByEntityAndDate($entity, \DateTime $date, $sort = null) + public function findByEntityAndDate($entity, \DateTime $date, $sort = null): mixed { $qb = $this->createQueryBuilder('c'); diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php index 2ba95e340..64d166345 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php @@ -45,7 +45,7 @@ class ResourceRepository extends ServiceEntityRepository return $qb->getQuery()->getResult(); } - public function findByEntityAndDate(Household|Person $entity, \DateTime $date, $sort = null) + public function findByEntityAndDate(Household|Person $entity, \DateTime $date, $sort = null): mixed { $qb = $this->createQueryBuilder('c'); diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index dad302193..2690ec286 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -123,7 +123,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente * @var Collection&Selectable */ #[Serializer\Groups(['read', 'docgen:read'])] - #[ORM\OneToMany(mappedBy: 'calendar', targetEntity: Invite::class, cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)] + #[ORM\OneToMany(mappedBy: 'calendar', targetEntity: Invite::class, cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)] #[ORM\JoinTable(name: 'chill_calendar.calendar_to_invites')] private Collection&Selectable $invites; diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultRangeGeneratorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultRangeGeneratorTest.php index 4fb6e99d6..12125b745 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultRangeGeneratorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultRangeGeneratorTest.php @@ -31,7 +31,7 @@ final class DefaultRangeGeneratorTest extends TestCase /** * @dataProvider generateData */ - public function testGenerateRange(\DateTimeImmutable $date, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate) + public function testGenerateRange(\DateTimeImmutable $date, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate): void { $generator = new DefaultRangeGenerator(); diff --git a/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php b/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php index 801903ca2..9d5fdfac7 100644 --- a/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php +++ b/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php @@ -21,7 +21,7 @@ class OptionRepository extends EntityRepository * * @return Option[] */ - public function findFilteredByKey($key, mixed $includeParents = true, mixed $active = true) + public function findFilteredByKey($key, mixed $includeParents = true, mixed $active = true): mixed { $qb = $this->createQueryBuilder('option'); $qb->where('option.key = :key'); diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php index 781963d43..14fb742f3 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php @@ -85,7 +85,7 @@ class AdminDocGeneratorTemplateController extends CRUDController * * @return QueryBuilder|mixed */ - protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator): \Doctrine\ORM\QueryBuilder { return $query->addSelect('JSON_EXTRACT(e.name, :lang) AS HIDDEN name_lang') ->setParameter('lang', $request->getLocale()) diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php index 237c16fb4..cde4748a2 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php @@ -31,7 +31,7 @@ final class DocGenEncoderTest extends TestCase $this->encoder = new DocGenEncoder(); } - public function testEmbeddedLoopsThrowsException() + public function testEmbeddedLoopsThrowsException(): void { $this->expectException(UnexpectedValueException::class); @@ -55,7 +55,7 @@ final class DocGenEncoderTest extends TestCase /** * @dataProvider generateEncodeData */ - public function testEncode(mixed $expected, mixed $data, string $msg) + public function testEncode(mixed $expected, mixed $data, string $msg): void { $generated = $this->encoder->encode($data, 'docgen'); $this->assertEquals($expected, $generated, $msg); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Driver/OpenstackObjectStore/StoredObjectManagerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Driver/OpenstackObjectStore/StoredObjectManagerTest.php index a42b3d7c9..975947808 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Driver/OpenstackObjectStore/StoredObjectManagerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Driver/OpenstackObjectStore/StoredObjectManagerTest.php @@ -34,7 +34,7 @@ final class StoredObjectManagerTest extends TestCase /** * @dataProvider getDataProviderForRead */ - public function testRead(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null) + public function testRead(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null): void { if (null !== $exceptionClass) { $this->expectException($exceptionClass); @@ -113,7 +113,7 @@ final class StoredObjectManagerTest extends TestCase /** * @dataProvider getDataProviderForWrite */ - public function testWrite(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null, ?int $errorCode = null) + public function testWrite(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null, ?int $errorCode = null): void { if (null !== $exceptionClass) { $this->expectException($exceptionClass); diff --git a/src/Bundle/ChillEventBundle/Repository/ParticipationRepository.php b/src/Bundle/ChillEventBundle/Repository/ParticipationRepository.php index 7c0c13edf..2e42a3ee5 100644 --- a/src/Bundle/ChillEventBundle/Repository/ParticipationRepository.php +++ b/src/Bundle/ChillEventBundle/Repository/ParticipationRepository.php @@ -43,7 +43,7 @@ class ParticipationRepository extends ServiceEntityRepository /** * Return paginated participations for a person and in reachables circles. */ - public function findByPersonInCircle($person_id, $reachablesCircles, $first, $max) + public function findByPersonInCircle($person_id, $reachablesCircles, $first, $max): mixed { return $this->createQueryBuilder('p') ->join('p.event', 'e') diff --git a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php index 457a02f17..21a5a1623 100644 --- a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php @@ -35,7 +35,7 @@ class SetPasswordCommand extends Command parent::__construct(); } - public function _getUser($username) + public function _getUser($username): ?object { return $this->entityManager ->getRepository(User::class) diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index 45180948e..333f894e1 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -391,7 +391,7 @@ class ExportController extends AbstractController * * @return Response */ - private function selectCentersStep(Request $request, DirectExportInterface|ExportInterface $export, $alias, ExportGeneration|SavedExport|null $savedExport = null) + private function selectCentersStep(Request $request, DirectExportInterface|ExportInterface $export, $alias, ExportGeneration|SavedExport|null $savedExport = null): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if (!$this->filterStatsByCenters) { return $this->redirectToRoute('chill_main_export_new', [ diff --git a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php index c5b9cd74f..fc2415026 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php @@ -37,7 +37,7 @@ class LocationApiController extends ApiController /** * @param QueryBuilder $query */ - protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format): \Doctrine\ORM\QueryBuilder { return $query ->addOrderBy('e.name', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php index 715054920..4697e6384 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php @@ -21,7 +21,7 @@ class Age extends FunctionNode private mixed $value2 = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { if (null !== $this->value2) { return sprintf( diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php index 5648773e3..8a41b3e49 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php @@ -33,7 +33,7 @@ class Extract extends FunctionNode // private FunctionNode $value; // private DateDiffFunction $value; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'EXTRACT(%s FROM %s)', diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php index aae16d1eb..e410645b6 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php @@ -21,7 +21,7 @@ class GetJsonFieldByKey extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $expr2 = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf( '(%s->%s)', diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php index 9fb1611c8..5f5c5d836 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php @@ -30,7 +30,7 @@ class Greatest extends FunctionNode */ private array $exprs = []; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return 'GREATEST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')'; } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php index 416970f01..050b99c06 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php @@ -25,7 +25,7 @@ class JsonAggregate extends FunctionNode { private ?\Doctrine\ORM\Query\AST\Node $expr = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf('jsonb_agg(%s)', $this->expr->dispatch($sqlWalker)); } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php index 49fd8f9bb..e1c25ce0b 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php @@ -29,7 +29,7 @@ class JsonBuildObject extends FunctionNode */ private array $exprs = []; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return 'JSONB_BUILD_OBJECT('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')'; } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php index 5537ec0f4..5561af810 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php @@ -21,7 +21,7 @@ class JsonExtract extends FunctionNode private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $keyToExtract = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf('%s->>%s', $this->element->dispatch($sqlWalker), $this->keyToExtract->dispatch($sqlWalker)); } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php index 8e60422fe..24e5ea0fc 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php @@ -30,7 +30,7 @@ class Least extends FunctionNode */ private array $exprs = []; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return 'LEAST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')'; } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php index edf00243f..1ba55ef19 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php @@ -31,7 +31,7 @@ class OverlapsI extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $secondPeriodStart = null; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) + public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string { return sprintf( '(%s, %s) OVERLAPS (%s, %s)', diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php index d42e78ad6..85ef1c3bb 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php @@ -22,7 +22,7 @@ class STContains extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $secondPart = null; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) + public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string { return 'ST_CONTAINS('.$this->firstPart->dispatch($sqlWalker). ', '.$this->secondPart->dispatch($sqlWalker).')'; diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php index 429c6c0cb..2f6b0e9d5 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php @@ -19,7 +19,7 @@ class STX extends FunctionNode { private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $field = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf('ST_X(%s)', $this->field->dispatch($sqlWalker)); } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php index acd837c7e..e6e28b4cb 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php @@ -19,7 +19,7 @@ class STY extends FunctionNode { private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $field = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf('ST_Y(%s)', $this->field->dispatch($sqlWalker)); } diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php index c2071202b..c87d1cd41 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php @@ -19,7 +19,7 @@ class Similarity extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $secondPart = null; - public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) + public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string { return 'SIMILARITY('.$this->firstPart->dispatch($sqlWalker). ', '.$this->secondPart->dispatch($sqlWalker).')'; diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php index d457ede2d..851d8077d 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php @@ -20,7 +20,7 @@ class StrictWordSimilarityOPS extends \Doctrine\ORM\Query\AST\Functions\Function private ?\Doctrine\ORM\Query\AST\Node $secondPart = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return $this->firstPart->dispatch($sqlWalker). ' <<% '.$this->secondPart->dispatch($sqlWalker); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php index 0c3c3ca9a..0046dfa60 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php @@ -24,7 +24,7 @@ class ToChar extends FunctionNode private \Doctrine\ORM\Query\AST\Node|string|null $fmt = null; - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { return sprintf( 'TO_CHAR(%s, %s)', diff --git a/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php b/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php index 110842a2a..392daf899 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php +++ b/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php @@ -17,7 +17,7 @@ final class FlatHierarchyEntityHydrator extends ObjectHydrator { public const LIST = 'chill_flat_hierarchy_list'; - protected function hydrateAllData() + protected function hydrateAllData(): array { return array_values(iterator_to_array($this->flatListGenerator($this->buildChildrenHashmap(parent::hydrateAllData())))); } diff --git a/src/Bundle/ChillMainBundle/Entity/Notification.php b/src/Bundle/ChillMainBundle/Entity/Notification.php index 19bf300f9..afc93d798 100644 --- a/src/Bundle/ChillMainBundle/Entity/Notification.php +++ b/src/Bundle/ChillMainBundle/Entity/Notification.php @@ -145,7 +145,7 @@ class Notification implements TrackUpdateInterface /** * @deprecated */ - public function addAddressesEmail(string $email) + public function addAddressesEmail(string $email): void { if (!\in_array($email, $this->addressesEmails, true)) { $this->addressesEmails[] = $email; diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 9bb4202d3..99cec97ce 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -638,7 +638,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter return $this->notificationFlags; } - public function setNotificationFlags(array $notificationFlags) + public function setNotificationFlags(array $notificationFlags): void { $this->notificationFlags = $notificationFlags; } diff --git a/src/Bundle/ChillMainBundle/Export/ExportGenerator.php b/src/Bundle/ChillMainBundle/Export/ExportGenerator.php index 7e2cfc6dd..33d7cecf4 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportGenerator.php +++ b/src/Bundle/ChillMainBundle/Export/ExportGenerator.php @@ -266,7 +266,7 @@ final readonly class ExportGenerator * * @param list
$centers */ - private function buildCenterReachableScopes(array $centers) + private function buildCenterReachableScopes(array $centers): array { return array_map(static fn (Center $center) => ['center' => $center, 'circles' => []], $centers); } diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index f5e9bfc4d..42135e626 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -136,7 +136,7 @@ class ExportManager * * @internal used by DI */ - public function addFormatter(FormatterInterface $formatter, string $alias) + public function addFormatter(FormatterInterface $formatter, string $alias): void { $this->formatters[$alias] = $formatter; } diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php index ede88a0cf..52210fe84 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php @@ -107,7 +107,7 @@ class CSVFormatter implements FormatterInterface return $descriptions; } - public function getName() + public function getName(): string|\Symfony\Contracts\Translation\TranslatableInterface { return 'Comma separated values (CSV)'; } @@ -140,7 +140,7 @@ class CSVFormatter implements FormatterInterface return $response; } - public function getType() + public function getType(): string { return 'tabular'; } diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php index 87c46dfbb..1c3f61f88 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php @@ -101,7 +101,7 @@ final class SpreadSheetFormatter implements FormatterInterface, ExportManagerAwa array $filtersData, array $aggregatorsData, ExportGenerationContext $context, - ) { + ): \Chill\MainBundle\Export\FormattedExportGeneration { // Initialize local variables instead of class properties /** @var ExportInterface $export */ $export = $this->getExportManager()->getExport($exportAlias); @@ -244,7 +244,7 @@ final class SpreadSheetFormatter implements FormatterInterface, ExportManagerAwa * Add the title to the worksheet and merge the cell containing * the title. */ - private function addTitleToWorkSheet(Worksheet &$worksheet, $export) + private function addTitleToWorkSheet(Worksheet &$worksheet, $export): void { $worksheet->setCellValue('A1', $this->getTitle($export)); $worksheet->mergeCells('A1:G1'); @@ -281,7 +281,7 @@ final class SpreadSheetFormatter implements FormatterInterface, ExportManagerAwa array $filtersData, array $aggregatorsData, array $cacheDisplayableResult, - ) { + ): void { [$spreadsheet, $worksheet] = $this->createSpreadsheet($export); $this->addTitleToWorkSheet($worksheet, $export); diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php index 27ee7f44c..3b0a2d469 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php @@ -195,7 +195,7 @@ class SpreadsheetListFormatter implements FormatterInterface, ExportManagerAware array $filtersData, array $aggregatorsData, ExportGenerationContext $context, - ) { + ): \Symfony\Component\HttpFoundation\BinaryFileResponse { $generated = $this->generate($result, $formatterData, $exportAlias, $exportData, $filtersData, $aggregatorsData, $context); $response = new BinaryFileResponse($generated->content); diff --git a/src/Bundle/ChillMainBundle/Export/Messenger/ExportRequestGenerationMessageHandler.php b/src/Bundle/ChillMainBundle/Export/Messenger/ExportRequestGenerationMessageHandler.php index 94610a995..574eac931 100644 --- a/src/Bundle/ChillMainBundle/Export/Messenger/ExportRequestGenerationMessageHandler.php +++ b/src/Bundle/ChillMainBundle/Export/Messenger/ExportRequestGenerationMessageHandler.php @@ -36,7 +36,7 @@ final readonly class ExportRequestGenerationMessageHandler implements MessageHan private LoggerInterface $logger, ) {} - public function __invoke(ExportRequestGenerationMessage $exportRequestGenerationMessage) + public function __invoke(ExportRequestGenerationMessage $exportRequestGenerationMessage): void { $start = microtime(true); diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserOrMeDynamicType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserOrMeDynamicType.php index 93ecd3f4e..83761f8ef 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserOrMeDynamicType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserOrMeDynamicType.php @@ -41,12 +41,12 @@ class PickUserOrMeDynamicType extends AbstractType private readonly NormalizerInterface $normalizer, ) {} - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addViewTransformer(new EntityToJsonTransformer($this->denormalizer, $this->serializer, $options['multiple'], 'user')); } - 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'] = ['user']; @@ -61,7 +61,7 @@ class PickUserOrMeDynamicType extends AbstractType // $user = /* should come from context */ $options['context']; } - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver ->setDefault('multiple', false) diff --git a/src/Bundle/ChillMainBundle/Form/UserProfileType.php b/src/Bundle/ChillMainBundle/Form/UserProfileType.php index f9fa65991..76f005e97 100644 --- a/src/Bundle/ChillMainBundle/Form/UserProfileType.php +++ b/src/Bundle/ChillMainBundle/Form/UserProfileType.php @@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class UserProfileType extends AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('phonenumber', ChillPhoneNumberType::class, [ @@ -32,7 +32,7 @@ class UserProfileType extends AbstractType ; } - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Chill\MainBundle\Entity\User::class, diff --git a/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php b/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php index 65292f849..8b4080f0e 100644 --- a/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php @@ -74,7 +74,7 @@ class NewsItemRepository implements ObjectRepository return $qb; } - public function findAllFilteredBySearchTerm(?string $pattern = null) + public function findAllFilteredBySearchTerm(?string $pattern = null): mixed { $qb = $this->buildBaseQuery($pattern); $qb @@ -105,7 +105,7 @@ class NewsItemRepository implements ObjectRepository ->getResult(); } - public function countAllFilteredBySearchTerm(?string $pattern = null) + public function countAllFilteredBySearchTerm(?string $pattern = null): mixed { $qb = $this->buildBaseQuery($pattern); @@ -115,7 +115,7 @@ class NewsItemRepository implements ObjectRepository ->getSingleScalarResult(); } - public function countCurrentNews() + public function countCurrentNews(): mixed { return $this->buildQueryCurrentNews() ->select('COUNT(n)') diff --git a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php index ff8e5ffd2..cce8b3874 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php @@ -68,7 +68,7 @@ readonly class UserJobRepository implements UserJobRepositoryInterface return $qb->getQuery()->getResult(); } - public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php index 9f44cbd5f..8c16ff210 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php @@ -237,7 +237,7 @@ abstract class AbstractFilterTest extends KernelTestCase } } - public function testApplyOn() + public function testApplyOn(): void { $filter = $this->getFilter(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php index ac711d66b..c084bfcdb 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php @@ -35,7 +35,7 @@ final class AddressControllerTest extends \Symfony\Bundle\FrameworkBundle\Test\W /** * @dataProvider generateAddressIds */ - public function testDuplicate(int $addressId) + public function testDuplicate(int $addressId): void { $this->client = $this->getClientAuthenticated(); $this->client->request('POST', "/api/1.0/main/address/{$addressId}/duplicate.json"); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/AddressReferenceApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/AddressReferenceApiControllerTest.php index 29d9eff48..860a029e3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/AddressReferenceApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/AddressReferenceApiControllerTest.php @@ -28,7 +28,7 @@ final class AddressReferenceApiControllerTest extends WebTestCase /** * @dataProvider provideData */ - public function testSearch(int $postCodeId, string $pattern) + public function testSearch(int $postCodeId, string $pattern): void { $client = $this->getClientAuthenticated(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php index 05c3e54f3..91fdbd7f6 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php @@ -55,7 +55,7 @@ class NewsItemControllerTest extends WebTestCase $em->flush(); } - public function testList() + public function testList(): void { $client = $this->getClientAuthenticated('admin', 'password'); $client->request('GET', '/fr/admin/news_item'); @@ -66,7 +66,7 @@ class NewsItemControllerTest extends WebTestCase /** * @dataProvider generateNewsItemIds */ - public function testShowSingleItem(NewsItem $newsItem) + public function testShowSingleItem(NewsItem $newsItem): void { $client = $this->getClientAuthenticated('admin', 'password'); $client->request('GET', "/fr/admin/news_item/{$newsItem->getId()}/view"); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php index 0bd8d798c..a4ebb33d5 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php @@ -51,7 +51,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase self::ensureKernelShutdown(); } - public function testList() + public function testList(): void { self::ensureKernelShutdown(); $client = $this->getClientAuthenticated(); @@ -64,7 +64,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase /** * @dataProvider generateNewsItemIds */ - public function testShowSingleItem(int $newsItemId) + public function testShowSingleItem(int $newsItemId): void { self::ensureKernelShutdown(); $client = $this->getClientAuthenticated(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php index 016e35456..439251b57 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php @@ -27,7 +27,7 @@ final class UserControllerTest extends WebTestCase { use PrepareClientTrait; - public function testList() + public function testList(): void { $client = $this->getClientAuthenticatedAsAdmin(); @@ -135,7 +135,7 @@ final class UserControllerTest extends WebTestCase yield [$user->getId(), $user->getUsername()]; } - protected function isPasswordValid($username, $password) + protected function isPasswordValid($username, $password): void { /** @var \Symfony\Component\PasswordHasher\Hasher\UserPasswordHasher $passwordEncoder */ $passwordEncoder = self::getContainer() diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php index 71b16413c..371971d8b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php @@ -34,7 +34,7 @@ final class AgeTest extends KernelTestCase /** * @dataProvider generateQueries */ - public function testWorking(string $dql, array $args) + public function testWorking(string $dql, array $args): void { $dql = $this->entityManager->createQuery($dql)->setMaxResults(3); diff --git a/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php b/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php index 18b20942f..e0ecc3a21 100644 --- a/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php @@ -44,7 +44,7 @@ final class NotificationTest extends KernelTestCase $em->flush(); } - public function testAddAddresseeStoreAnUread() + public function testAddAddresseeStoreAnUread(): void { $notification = new Notification(); $notification->addAddressee($user1 = new User()); diff --git a/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php b/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php index c47c4c878..a35bf4fd6 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/Cronjob/RemoveExpiredExportGenerationCronJobTest.php @@ -32,7 +32,7 @@ class RemoveExpiredExportGenerationCronJobTest extends TestCase { use ProphecyTrait; - public function testCanRunReturnsTrueWhenLastExecutionIsNull() + public function testCanRunReturnsTrueWhenLastExecutionIsNull(): void { $clock = new MockClock(new \DateTimeImmutable('2024-06-25 10:00:00')); $repo = $this->prophesize(ExportGenerationRepository::class); @@ -47,7 +47,7 @@ class RemoveExpiredExportGenerationCronJobTest extends TestCase $this->assertTrue($cronJob->canRun(null)); } - public function testCanRunReturnsTrueWhenLastStartIsOlderThan24Hours() + public function testCanRunReturnsTrueWhenLastStartIsOlderThan24Hours(): void { $clock = new MockClock(new \DateTimeImmutable('2024-06-25 10:00:00')); $repo = $this->prophesize(ExportGenerationRepository::class); @@ -65,7 +65,7 @@ class RemoveExpiredExportGenerationCronJobTest extends TestCase $this->assertTrue($cronJob->canRun($execution)); } - public function testCanRunReturnsFalseWhenLastStartIsWithin24Hours() + public function testCanRunReturnsFalseWhenLastStartIsWithin24Hours(): void { $clock = new MockClock(new \DateTimeImmutable('2024-06-25 10:00:00')); $repo = $this->prophesize(ExportGenerationRepository::class); @@ -83,7 +83,7 @@ class RemoveExpiredExportGenerationCronJobTest extends TestCase $this->assertFalse($cronJob->canRun($execution)); } - public function testRunDispatchesMessagesForExpiredExportsAndReturnsLastDeletion() + public function testRunDispatchesMessagesForExpiredExportsAndReturnsLastDeletion(): void { $clock = new MockClock(new \DateTimeImmutable('2024-06-25 11:21:00')); $repo = $this->prophesize(ExportGenerationRepository::class); diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportDataNormalizerTraitTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportDataNormalizerTraitTest.php index 0e3d3d502..fc2de5882 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportDataNormalizerTraitTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportDataNormalizerTraitTest.php @@ -36,7 +36,7 @@ class ExportDataNormalizerTraitTest extends TestCase return $this->normalizeDoctrineEntity($entity); } - public function denormalizeEntity(mixed $entity, ObjectRepository $repository) + public function denormalizeEntity(mixed $entity, ObjectRepository $repository): object|array { return $this->denormalizeDoctrineEntity($entity, $repository); } diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportGeneratorTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportGeneratorTest.php index e01dc6566..c1846553c 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportGeneratorTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportGeneratorTest.php @@ -54,7 +54,7 @@ class ExportGeneratorTest extends TestCase ); } - public function testGenerateHappyScenario() + public function testGenerateHappyScenario(): void { $initialData = ['initial' => 'test']; $fullConfig = [ @@ -168,7 +168,7 @@ class ExportGeneratorTest extends TestCase self::assertEquals('text/text', $actual->contentType); } - public function testGenerateNativeSqlHappyScenario() + public function testGenerateNativeSqlHappyScenario(): void { $initialData = ['initial' => 'test']; $fullConfig = [ @@ -241,7 +241,7 @@ class ExportGeneratorTest extends TestCase self::assertEquals('text/text', $actual->contentType); } - public function testGenerateDirectExportHappyScenario() + public function testGenerateDirectExportHappyScenario(): void { $initialData = ['initial' => 'test']; $fullConfig = [ @@ -295,7 +295,7 @@ class ExportGeneratorTest extends TestCase self::assertEquals('text/text', $actual->contentType); } - public function testGenerateHappyScenarioWithoutCenterFiltering() + public function testGenerateHappyScenarioWithoutCenterFiltering(): void { $initialData = ['initial' => 'test']; $fullConfig = [ diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index 6004a6012..c5ab720d3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -64,7 +64,7 @@ final class ExportManagerTest extends KernelTestCase $this->prophet->checkPredictions(); } - public function testAggregatorsApplyingOn() + public function testAggregatorsApplyingOn(): void { $centers = [$center = new Center()]; $user = $this->prepareUser([]); @@ -125,7 +125,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertEquals(0, \count($obtained)); } - public function testFiltersApplyingOn() + public function testFiltersApplyingOn(): void { $centers = [$center = new Center()]; $user = $this->prepareUser([]); @@ -172,7 +172,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertEquals(0, \count($obtained)); } - public function testFormattersByTypes() + public function testFormattersByTypes(): void { $exportManager = $this->createExportManager(); @@ -192,7 +192,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertNotContains($formatterBar->reveal(), $obtained); } - public function testIsGrantedForElementWithExportAndUserIsGranted() + public function testIsGrantedForElementWithExportAndUserIsGranted(): void { $center = $this->prepareCenter(100, 'center A'); $user = $this->prepareUser([]); @@ -220,7 +220,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertTrue($result); } - public function testIsGrantedForElementWithExportAndUserIsGrantedNotForAllCenters() + public function testIsGrantedForElementWithExportAndUserIsGrantedNotForAllCenters(): void { $center = $this->prepareCenter(100, 'center A'); $centerB = $this->prepareCenter(102, 'center B'); @@ -250,7 +250,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertFalse($result); } - public function testIsGrantedForElementWithExportEmptyCenters() + public function testIsGrantedForElementWithExportEmptyCenters(): void { $user = $this->prepareUser([]); @@ -271,7 +271,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertFalse($result); } - public function testIsGrantedForElementWithModifierFallbackToExport() + public function testIsGrantedForElementWithModifierFallbackToExport(): void { $center = $this->prepareCenter(100, 'center A'); $centerB = $this->prepareCenter(102, 'center B'); @@ -309,7 +309,7 @@ final class ExportManagerTest extends KernelTestCase $this->assertFalse($result); } - public function testNonExistingFormatter() + public function testNonExistingFormatter(): void { $this->expectException(\RuntimeException::class); @@ -486,7 +486,7 @@ class DummyExport implements ExportInterface return $this->role; } - public function supportsModifiers() + public function supportsModifiers(): array { return $this->supportedModifiers; } diff --git a/src/Bundle/ChillMainBundle/Tests/Export/Messenger/RemoveExportGenerationMessageHandlerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/Messenger/RemoveExportGenerationMessageHandlerTest.php index 70f6f9f75..cc579f636 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/Messenger/RemoveExportGenerationMessageHandlerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/Messenger/RemoveExportGenerationMessageHandlerTest.php @@ -30,7 +30,7 @@ class RemoveExportGenerationMessageHandlerTest extends TestCase { use ProphecyTrait; - public function testInvokeUpdatesDeleteAtAndRemovesAndFlushes() + public function testInvokeUpdatesDeleteAtAndRemovesAndFlushes(): void { // Arrange diff --git a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php index a43d643dd..f17900fcb 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php @@ -108,7 +108,7 @@ class SortExportElementTest extends KernelTestCase private function makeTranslator(): TranslatorInterface { return new class () implements TranslatorInterface { - public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null) + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { return $id; } diff --git a/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php b/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php index bae72a39d..3a931db3c 100644 --- a/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php @@ -103,7 +103,7 @@ final class PageTest extends KernelTestCase ]; } - public function testPageNumber() + public function testPageNumber(): void { $page = $this->generatePage(1); diff --git a/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php b/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php index 0ea2e853e..5c0ab9b3b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php @@ -34,7 +34,7 @@ final class PaginatorTest extends KernelTestCase $this->prophet = new \Prophecy\Prophet(); } - public function testGetPage() + public function testGetPage(): void { $paginator = $this->generatePaginator(105, 10); @@ -184,7 +184,7 @@ final class PaginatorTest extends KernelTestCase ]; } - public function testPagesGenerator() + public function testPagesGenerator(): void { $paginator = $this->generatePaginator(105, 10); diff --git a/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php index 182980dd0..a74243c64 100644 --- a/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php @@ -28,7 +28,7 @@ final class PhonenumberHelperTest extends KernelTestCase /** * @dataProvider formatPhonenumbers */ - public function testFormatPhonenumbers(string $defaultCarrierCode, string $phoneNumber, string $expected) + public function testFormatPhonenumbers(string $defaultCarrierCode, string $phoneNumber, string $expected): void { $util = PhoneNumberUtil::getInstance(); $subject = new PhonenumberHelper( diff --git a/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractPhonenumberFromPatternTest.php b/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractPhonenumberFromPatternTest.php index 3f5950a4c..78e08504e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractPhonenumberFromPatternTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractPhonenumberFromPatternTest.php @@ -25,7 +25,7 @@ final class ExtractPhonenumberFromPatternTest extends KernelTestCase /** * @dataProvider provideData */ - public function testExtract(string $defaultCarrierCode, mixed $subject, mixed $expectedCount, mixed $expected, mixed $filteredSubject, mixed $msg) + public function testExtract(string $defaultCarrierCode, mixed $subject, mixed $expectedCount, mixed $expected, mixed $filteredSubject, mixed $msg): void { $extractor = new ExtractPhonenumberFromPattern(new ParameterBag(['chill_main' => [ 'phone_helper' => ['default_carrier_code' => $defaultCarrierCode], diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index b19e201d5..c723f3e09 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -48,7 +48,7 @@ final class AuthorizationHelperTest extends KernelTestCase /** * @group legacy */ - public function testGetParentRoles() + public function testGetParentRoles(): void { $parentRoles = $this->getAuthorizationHelper() ->getParentRoles('CHILL_INHERITED_ROLE_1'); @@ -63,7 +63,7 @@ final class AuthorizationHelperTest extends KernelTestCase /** * @dataProvider dataProvider_getReachableCenters */ - public function testGetReachableCenters(mixed $test, mixed $result, mixed $msg) + public function testGetReachableCenters(mixed $test, mixed $result, mixed $msg): void { $this->assertEquals($test, $result, $msg); } @@ -179,7 +179,7 @@ final class AuthorizationHelperTest extends KernelTestCase string $role, Center $center, $message, - ) { + ): void { $reachableScopes = $this->getAuthorizationHelper() ->getReachableScopes($user, $role, $center); @@ -245,7 +245,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]; } - public function testtestUserHasAccessUserShouldHaveAccessEntityWithScope() + public function testtestUserHasAccessUserShouldHaveAccessEntityWithScope(): void { $center = $this->prepareCenter(1, 'center'); $scope = $this->prepareScope(1, 'default'); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php index 16de1fab3..1acb6182d 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php @@ -35,7 +35,7 @@ final class DateNormalizerTest extends KernelTestCase /** * @dataProvider generateDataNormalize */ - public function testNormalize(mixed $expected, mixed $date, mixed $format, mixed $locale, mixed $msg) + public function testNormalize(mixed $expected, mixed $date, mixed $format, mixed $locale, mixed $msg): void { $this->assertEquals($expected, $this->buildDateNormalizer($locale)->normalize($date, $format, []), $msg); } @@ -71,7 +71,7 @@ final class DateNormalizerTest extends KernelTestCase ]; } - public function testSupports() + public function testSupports(): void { $this->assertTrue($this->buildDateNormalizer()->supportsNormalization(new \DateTime(), 'json')); $this->assertTrue($this->buildDateNormalizer()->supportsNormalization(new \DateTimeImmutable(), 'json')); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php index 691e32f26..0afe04416 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php @@ -38,7 +38,7 @@ final class DoctrineExistingEntityNormalizerTest extends KernelTestCase /** * @dataProvider dataProviderUserId */ - public function testGetMappedClass(mixed $userId) + public function testGetMappedClass(mixed $userId): void { $data = ['type' => 'user', 'id' => $userId]; $supports = $this->normalizer->supportsDenormalization($data, User::class); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php index dacdace88..082098fb0 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php @@ -43,7 +43,7 @@ final class UserNormalizerTest extends TestCase * * @throws ExceptionInterface */ - public function testNormalize(?User $user, mixed $format, mixed $context, mixed $expected) + public function testNormalize(?User $user, mixed $format, mixed $context, mixed $expected): void { $userRender = $this->prophesize(UserRender::class); $userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : ''); @@ -52,12 +52,12 @@ final class UserNormalizerTest extends TestCase $normalizer = new UserNormalizer($userRender->reveal(), $clock); $normalizer->setNormalizer(new class () implements NormalizerInterface { - public function normalize($object, ?string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []): string|int|float|bool|\ArrayObject|array|null { return ['context' => $context['docgen:expects'] ?? null]; } - public function supportsNormalization($data, ?string $format = null) + public function supportsNormalization($data, ?string $format = null): bool { return true; } diff --git a/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php b/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php index eda10fb11..c3616f72f 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php @@ -28,7 +28,7 @@ final class RollingDateConverterTest extends TestCase return new RollingDateConverter(new MockClock($pivot)); } - public function testConversionFixedDate() + public function testConversionFixedDate(): void { $rollingDate = new RollingDate(RollingDate::T_FIXED_DATE, new \DateTimeImmutable('2022-01-01')); @@ -69,7 +69,7 @@ final class RollingDateConverterTest extends TestCase /** * @dataProvider generateDataConversionDate */ - public function testConvertOnClock(string $roll, string $expectedDateTime, string $format) + public function testConvertOnClock(string $roll, string $expectedDateTime, string $format): void { $pivot = \DateTimeImmutable::createFromFormat('Y-m-d His', '2022-11-07 000000'); $rollingDate = new RollingDate($roll, null); diff --git a/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/EntityWorkflowGuardUnsignedTransitionTest.php b/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/EntityWorkflowGuardUnsignedTransitionTest.php index 5e8a294fa..7245dcaa3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/EntityWorkflowGuardUnsignedTransitionTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/EntityWorkflowGuardUnsignedTransitionTest.php @@ -120,7 +120,7 @@ class EntityWorkflowGuardUnsignedTransitionTest extends TestCase /** * @dataProvider guardWaitingForSignatureWithPermissionToApplyAllTransitionsProvider */ - public function testGuardWaitingForSignatureWithPermissionToApplyAllTransitions(EntityWorkflow $entityWorkflow, string $transition, bool $expectIsGranted, string $message) + public function testGuardWaitingForSignatureWithPermissionToApplyAllTransitions(EntityWorkflow $entityWorkflow, string $transition, bool $expectIsGranted, string $message): void { $chillEntityRender = $this->prophesize(ChillEntityRenderManagerInterface::class); $chillEntityRender->renderString(Argument::type('object'), Argument::type('array'))->will(fn ($args) => spl_object_hash($args[0])); diff --git a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php index 375640ec2..cafbfeb7d 100644 --- a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php +++ b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php @@ -60,7 +60,7 @@ class TimelineBuilder * * @return \Doctrine\DBAL\Driver\Statement|mixed|null */ - public function countItems($context, array $args) + public function countItems($context, array $args): mixed { $rsm = (new ResultSetMapping()) ->addScalarResult('total', 'total', Types::INTEGER); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php index 84d5fea0b..1508fee7c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php @@ -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(); diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index 59a8d89fc..66ecdf705 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -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) diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php index 840d87f3b..a75c6ad83 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php @@ -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)', diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 7537fd716..9dc87b92f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -215,7 +215,7 @@ class AccompanyingPeriod implements * @var Collection */ #[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; diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index d04fee2d1..7d39b0f35 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -39,7 +39,7 @@ class Household implements HasCentersInterface * @var Collection */ #[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; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index aac4b528e..91853c78a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -85,7 +85,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @var Collection */ - #[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 */ - #[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 */ - #[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 */ #[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; /** diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index c35b506d3..ab88a9ff5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -209,7 +209,7 @@ class ListPerson implements ListInterface, GroupedExportInterface * * @return CustomField[] */ - private function getCustomFields() + private function getCustomFields(): mixed { return $this->entityManager ->createQuery('SELECT cf ' diff --git a/src/Bundle/ChillPersonBundle/Form/FindAccompanyingPeriodWorkType.php b/src/Bundle/ChillPersonBundle/Form/FindAccompanyingPeriodWorkType.php index ab78cb541..7020d3437 100644 --- a/src/Bundle/ChillPersonBundle/Form/FindAccompanyingPeriodWorkType.php +++ b/src/Bundle/ChillPersonBundle/Form/FindAccompanyingPeriodWorkType.php @@ -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') diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickLinkedAccompanyingPeriodWorkType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickLinkedAccompanyingPeriodWorkType.php index 55eda49e6..6da33086b 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickLinkedAccompanyingPeriodWorkType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickLinkedAccompanyingPeriodWorkType.php @@ -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') diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php index de5df1347..f1420265e 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php @@ -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'); diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php index 271883080..4c6a59c54 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php @@ -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'); diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index 6d6373999..4498b6bc2 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -78,7 +78,7 @@ class PersonRepository implements ObjectRepository $firstResult, $maxResults, array $only = ['mobile', 'phone'], - ) { + ): mixed { $qb = $this->repository->createQueryBuilder('p'); $qb->select('p'); diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php index e0020aff2..c5d1dfc1c 100644 --- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php +++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php @@ -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 diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php index 7761f3c39..f6d7cf4da 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php @@ -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)); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php index f9ac84cc4..9a5d8be43 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php @@ -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'); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php index de7369469..86dc31add 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php @@ -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(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php index 71078571e..d60f965b4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php @@ -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); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php index 65f2e60a6..e7f914560 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php @@ -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(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php index 9fa096c13..b66366587 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php @@ -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(); } diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index da91602de..d8b3eb5f7 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -54,7 +54,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface public function __construct(protected CustomFieldsGroup $customfieldsGroup, protected TranslatableStringHelper $translatableStringHelper, protected TranslatorInterface $translator, protected CustomFieldProvider $customFieldProvider, protected EntityManagerInterface $em) {} - public function buildForm(FormBuilderInterface $builder) + public function buildForm(FormBuilderInterface $builder): void { $choices = array_combine($this->fields, $this->fields); @@ -128,7 +128,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface return [FormatterInterface::TYPE_LIST]; } - public function getDescription() + public function getDescription(): string { return $this->translator->trans( "Generate list of report '%type%'", @@ -469,7 +469,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface * * @return CustomField[] */ - private function getCustomFields() + private function getCustomFields(): array { return array_filter($this->customfieldsGroup ->getCustomFields()->toArray(), static fn (CustomField $cf) => 'title' !== $cf->getType()); diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 4fa764559..0f13cb352 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -67,7 +67,7 @@ final class ReportVoterTest extends KernelTestCase $action, $message, ?User $user = null, - ) { + ): void { $token = $this->prepareToken($user); $result = $this->voter->vote($token, $report, [$action]); $this->assertEquals($expectedResult, $result, $message); diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php index 10a000f0e..7fa7a3c4c 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php @@ -227,7 +227,7 @@ class SingleTaskListType extends AbstractType * * @return User[] */ - protected function getUsersAssigneedToTask(mixed $options) + protected function getUsersAssigneedToTask(mixed $options): mixed { $qb = $this->em->createQueryBuilder(); $user = $this->tokenStorage->getToken()->getUser(); diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index d1a9ba13a..3f3a245c3 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -86,7 +86,7 @@ class SingleTaskRepository extends EntityRepository * * @return type */ - public function findByParameters($params, User $currentUser, int $firstResult = 0, int $maxResults = 50) + public function findByParameters($params, User $currentUser, int $firstResult = 0, int $maxResults = 50): mixed { $qb = $this->createQueryBuilder('st'); @@ -228,7 +228,7 @@ class SingleTaskRepository extends EntityRepository } } - private function buildIsClosed(QueryBuilder $qb, bool $negative = false) + private function buildIsClosed(QueryBuilder $qb, bool $negative = false): \Doctrine\ORM\Query\Expr\Comparison { if (false === $negative) { return $qb->expr()->eq('st.closed', "'TRUE'"); @@ -237,7 +237,7 @@ class SingleTaskRepository extends EntityRepository return $qb->expr()->eq('st.closed', "'FALSE'"); } - private function buildNowIsAfterEndDate(QueryBuilder $qb, $negative = false) + private function buildNowIsAfterEndDate(QueryBuilder $qb, $negative = false): \Doctrine\ORM\Query\Expr\Base { if (false === $negative) { return $qb->expr()->andX() @@ -254,7 +254,7 @@ class SingleTaskRepository extends EntityRepository ->add($qb->expr()->isNull('st.endDate')); } - private function buildNowIsAfterStartDate(QueryBuilder $qb, bool $negative = false) + private function buildNowIsAfterStartDate(QueryBuilder $qb, bool $negative = false): \Doctrine\ORM\Query\Expr\Base { if (false === $negative) { return $qb->expr()->orX() @@ -268,7 +268,7 @@ class SingleTaskRepository extends EntityRepository ->add($qb->expr()->isNotNull('st.startDate')); } - private function buildNowIsAfterWarningDate(QueryBuilder $qb, bool $negative = false) + private function buildNowIsAfterWarningDate(QueryBuilder $qb, bool $negative = false): \Doctrine\ORM\Query\Expr\Base { if (false === $negative) { return $qb->expr()->andX() @@ -308,7 +308,7 @@ class SingleTaskRepository extends EntityRepository ->getSingleScalarResult(); } - public function findAllTaskDistinctTypes() + public function findAllTaskDistinctTypes(): mixed { $qb = $this->createQueryBuilder('st') ->select('DISTINCT st.type'); diff --git a/symfony.lock b/symfony.lock index ff5da9c9f..b6a307005 100644 --- a/symfony.lock +++ b/symfony.lock @@ -2,25 +2,6 @@ "champs-libres/wopi-bundle": { "version": "dev-master" }, - "doctrine/annotations": { - "version": "2.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.10", - "ref": "64d8583af5ea57b7afa4aba4b159907f3a148b05" - }, - "files": [] - }, - "doctrine/deprecations": { - "version": "1.1", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.0", - "ref": "87424683adc81d7dc305eefec1fced883084aab9" - } - }, "doctrine/deprecations": { "version": "1.1", "recipe": {