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

@@ -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->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, [

View File

@@ -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();

View File

@@ -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));

View File

@@ -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();

View File

@@ -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');

View File

@@ -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');

View File

@@ -123,7 +123,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
* @var Collection<int, Invite>&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;

View File

@@ -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();

View File

@@ -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');

View File

@@ -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())

View File

@@ -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);

View File

@@ -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);

View File

@@ -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')

View File

@@ -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)

View File

@@ -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', [

View File

@@ -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');

View File

@@ -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(

View File

@@ -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)',

View File

@@ -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)',

View File

@@ -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)).')';
}

View File

@@ -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));
}

View File

@@ -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)).')';
}

View File

@@ -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));
}

View File

@@ -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)).')';
}

View File

@@ -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)',

View File

@@ -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).')';

View File

@@ -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));
}

View File

@@ -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));
}

View File

@@ -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).')';

View File

@@ -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);

View File

@@ -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)',

View File

@@ -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()))));
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -266,7 +266,7 @@ final readonly class ExportGenerator
*
* @param list<Center> $centers
*/
private function buildCenterReachableScopes(array $centers)
private function buildCenterReachableScopes(array $centers): array
{
return array_map(static fn (Center $center) => ['center' => $center, 'circles' => []], $centers);
}

View File

@@ -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;
}

View File

@@ -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';
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)

View File

@@ -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,

View File

@@ -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)')

View File

@@ -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);
}

View File

@@ -237,7 +237,7 @@ abstract class AbstractFilterTest extends KernelTestCase
}
}
public function testApplyOn()
public function testApplyOn(): void
{
$filter = $this->getFilter();

View File

@@ -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");

View File

@@ -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();

View File

@@ -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");

View File

@@ -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();

View File

@@ -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()

View File

@@ -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);

View File

@@ -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());

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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 = [

View File

@@ -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;
}

View File

@@ -30,7 +30,7 @@ class RemoveExportGenerationMessageHandlerTest extends TestCase
{
use ProphecyTrait;
public function testInvokeUpdatesDeleteAtAndRemovesAndFlushes()
public function testInvokeUpdatesDeleteAtAndRemovesAndFlushes(): void
{
// Arrange

View File

@@ -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;
}

View File

@@ -103,7 +103,7 @@ final class PageTest extends KernelTestCase
];
}
public function testPageNumber()
public function testPageNumber(): void
{
$page = $this->generatePage(1);

View File

@@ -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);

View File

@@ -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(

View File

@@ -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],

View File

@@ -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');

View File

@@ -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'));

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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]));

View File

@@ -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);

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();
}

View File

@@ -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());

View File

@@ -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);

View File

@@ -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();

View File

@@ -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');

View File

@@ -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": {