diff --git a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php index 9094169c2..e4ffd99c0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php @@ -27,7 +27,7 @@ final readonly class CategoryRender implements ChillEntityRenderInterface public const SEPERATOR_KEY = 'default.separator'; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private EngineInterface $engine) + public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine) { } diff --git a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php index c48c952a1..83cfdc1da 100644 --- a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php +++ b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php @@ -22,7 +22,7 @@ use Symfony\Component\Templating\EngineInterface; */ final readonly class BudgetElementTypeRender implements ChillEntityRenderInterface { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private EngineInterface $engine) + public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine) { } diff --git a/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php b/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php index de9b5477f..110adccdc 100644 --- a/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php +++ b/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php @@ -34,7 +34,7 @@ class AzureGrantAdminConsentAndAcquireToken extends Command parent::__construct('chill:calendar:msgraph-grant-admin-consent'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { /** @var FormatterHelper $formatter */ $formatter = $this->getHelper('formatter'); diff --git a/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php b/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php index 8222d0ace..a027c1bc2 100644 --- a/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php +++ b/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php @@ -35,7 +35,7 @@ class SendShortMessageOnEligibleCalendar extends Command return 'chill:calendar:send-short-messages'; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->messageSender->sendBulkMessageToEligibleCalendars(); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php index 6542f5c97..cde6bcfe7 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php @@ -33,7 +33,7 @@ use UnexpectedValueException; class CalendarDocController { - public function __construct(private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly EngineInterface $engine, private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly Security $security, private readonly UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly \Twig\Environment $engine, private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly Security $security, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php index c4d8e0b70..5b52a6ecd 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php @@ -57,7 +57,7 @@ class RemoteEventConverter private readonly DateTimeZone $remoteDateTimeZone; public function __construct( - private readonly EngineInterface $engine, + private readonly \Twig\Environment $engine, private readonly LocationConverter $locationConverter, private readonly LoggerInterface $logger, private readonly PersonRenderInterface $personRender, diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php index 8177be31a..d96cb450e 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php @@ -24,7 +24,7 @@ use Symfony\Component\Templating\EngineInterface; class DefaultShortMessageForCalendarBuilder implements ShortMessageForCalendarBuilderInterface { - public function __construct(private readonly EngineInterface $engine) + public function __construct(private readonly \Twig\Environment $engine) { } diff --git a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php index 827e22381..7623cba64 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php @@ -61,7 +61,7 @@ final class AddressConverterTest extends TestCase private function buildAddressConverter(): AddressConverter { - $engine = $this->prophesize(EngineInterface::class); + $engine = $this->prophesize(\Twig\Environment::class); $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); $translatableStringHelper->localize(Argument::type('array'))->will(static fn ($args): string => ($args[0] ?? ['fr' => 'not provided'])['fr'] ?? 'not provided'); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php index 6d42540cc..67d124c40 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php @@ -64,7 +64,7 @@ final class DefaultShortMessageForCalendarBuilderTest extends TestCase ->setMobilenumber($this->phoneNumberUtil->parse('+32470123456', 'BE')) ->setAcceptSMS(false); - $engine = $this->prophesize(EngineInterface::class); + $engine = $this->prophesize(\Twig\Environment::class); $engine->render(Argument::exact('@ChillCalendar/CalendarShortMessage/short_message.txt.twig'), Argument::withKey('calendar')) ->willReturn('message content') ->shouldBeCalledTimes(1); diff --git a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php index 40a946bd2..c6a3fb63c 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php +++ b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php @@ -85,10 +85,7 @@ class CreateFieldsOnGroupCommand extends Command } } - /** - * @return int|void|null - */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $helper = $this->getHelperSet()->get('question'); @@ -138,6 +135,7 @@ class CreateFieldsOnGroupCommand extends Command ); $fields = $this->_addFields($customFieldsGroup, $fieldsInput, $output); + return 0; } private function _addFields(CustomFieldsGroup $group, $values, OutputInterface $output) diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php index 5f7351372..74115cfd3 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php @@ -35,7 +35,7 @@ class CustomFieldLongChoice extends AbstractCustomField public function __construct( private readonly OptionRepository $optionRepository, private readonly TranslatableStringHelper $translatableStringHelper, - private readonly EngineInterface $templating, + private readonly \Twig\Environment $templating, ) { } diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 6b4192004..bb87a2f09 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -49,7 +49,7 @@ class EventSearch extends AbstractSearch TokenStorageInterface $tokenStorage, private readonly EntityRepository $er, private readonly AuthorizationHelper $helper, - private readonly TemplatingEngine $templating, + private readonly \Twig\Environment $templating, private readonly PaginatorFactory $paginationFactory ) { $this->user = $tokenStorage->getToken()->getUser(); diff --git a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php index 48d460875..03c8b5742 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php @@ -198,7 +198,7 @@ class ChillImportUsersCommand extends Command return false; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->tempOutput = $output; $this->tempInput = $input; @@ -218,6 +218,7 @@ class ChillImportUsersCommand extends Command } catch (Exception $e) { throw $e; } + return 0; } /** diff --git a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php index b7ef472a4..cb99db829 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php @@ -101,7 +101,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command ->addOption('subject', null, InputOption::VALUE_REQUIRED, 'Subject of the email', 'Recover your password'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->input = $input; $this->output = $output; @@ -119,6 +119,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command $this->sendRecoverCode($user); } + return 0; } /** diff --git a/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php b/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php index b3f9a9f4d..ec38fa173 100644 --- a/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php @@ -34,7 +34,7 @@ class ExecuteCronJobCommand extends Command ->addUsage(''); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { if ([] === $input->getArgument('job')) { $this->cronManager->run(); diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php index 729051ea3..096845f47 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php @@ -80,7 +80,7 @@ class LoadAndUpdateLanguagesCommand extends Command * * @see \Symfony\Component\Console\Command\Command::execute() */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $em = $this->entityManager; $chillAvailableLanguages = $this->availableLanguages; @@ -130,5 +130,6 @@ class LoadAndUpdateLanguagesCommand extends Command } $em->flush(); + return 0; } } diff --git a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php index c5cbdd78a..c26c698c1 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php @@ -73,7 +73,7 @@ class LoadCountriesCommand extends Command * * @see \Symfony\Component\Console\Command\Command::execute() */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $countries = static::prepareCountryList($this->availableLanguages); $em = $this->entityManager; @@ -90,5 +90,6 @@ class LoadCountriesCommand extends Command } $em->flush(); + return 0; } } diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index 7bda1d672..4bbc459a7 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -72,7 +72,7 @@ class LoadPostalCodesCommand extends Command ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $csv = $this->getCSVResource($input); @@ -105,6 +105,7 @@ class LoadPostalCodesCommand extends Command $this->entityManager->flush(); $output->writeln('' . $num . ' were added !'); + return 0; } private function addPostalCode($row, OutputInterface $output) diff --git a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php index c5eec91be..d27f18848 100644 --- a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php @@ -63,7 +63,7 @@ class SetPasswordCommand extends Command ->addArgument('password', InputArgument::OPTIONAL, 'the new password'); } - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $user = $this->_getUser($input->getArgument('username')); @@ -81,5 +81,6 @@ class SetPasswordCommand extends Command } $this->_setPassword($user, $password); + return 0; } } diff --git a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php index 923394da9..0932c199a 100644 --- a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php @@ -36,7 +36,7 @@ use function count; class SavedExportController { - public function __construct(private readonly EngineInterface $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index 082bff84c..6e35aecdc 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -40,7 +40,7 @@ class Mailer * @param $routeParameters * @param mixed[] $routeParameters */ - public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly EngineInterface $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters) + public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly \Twig\Environment $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters) { } diff --git a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php index cc02dc822..35e6211b7 100644 --- a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php +++ b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php @@ -64,7 +64,6 @@ class RollingDate final public const T_YEAR_PREVIOUS_START = 'year_previous_start'; /** - * @param string $roll * @param DateTimeImmutable|null $fixedDate Only to insert if $roll equals @see{self::T_FIXED_DATE} * @param DateTimeImmutable $pivotDate Will be "now" if null is given */ diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index c952bb5aa..648d7b734 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -36,7 +36,7 @@ class AddressRender implements ChillEntityRenderInterface 'extended_infos' => false, ]; - public function __construct(private readonly EngineInterface $templating, private readonly TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly \Twig\Environment $templating, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php index ff8ea0dc3..0d42d2601 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php @@ -25,7 +25,7 @@ class CommentRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly EngineInterface $engine) + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly \Twig\Environment $engine) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 880ee8587..a83e5369e 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -30,7 +30,7 @@ class UserRender implements ChillEntityRenderInterface 'absence' => true, ]; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EngineInterface $engine, private readonly TranslatorInterface $translator) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php index 62bab9973..c8f062301 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php @@ -220,7 +220,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderComplexAddressBE(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -232,7 +232,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderComplexAddressFR(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -244,7 +244,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderNoFullAddressBE(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -256,7 +256,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderStringSimpleAddressBE(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -268,7 +268,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderStringSimpleAddressFR(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -280,7 +280,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderWithBuildingAddressBE(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -292,7 +292,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderWithBuildingAddressFR(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -304,7 +304,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderWithStepsAddressBE(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); @@ -316,7 +316,7 @@ final class AddressRenderTest extends KernelTestCase */ public function testRenderWithStepsAddressFR(Address $addr, string $expectedString): void { - $engine = self::$container->get(EngineInterface::class); + $engine = self::$container->get(\Twig\Environment::class); $translatableStringHelper = self::$container->get(TranslatableStringHelper::class); $renderer = new AddressRender($engine, $translatableStringHelper); diff --git a/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/NotificationOnTransitionTest.php b/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/NotificationOnTransitionTest.php index 8cc190e65..c85ff3c05 100644 --- a/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/NotificationOnTransitionTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Workflow/EventSubscriber/NotificationOnTransitionTest.php @@ -84,7 +84,7 @@ final class NotificationOnTransitionTest extends TestCase } ); - $engine = $this->prophesize(EngineInterface::class); + $engine = $this->prophesize(\Twig\Environment::class); $engine->render(Argument::type('string'), Argument::type('array')) ->willReturn('dummy text'); diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php index 78b165a85..a79f726ba 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php @@ -25,7 +25,7 @@ use function in_array; class NotificationOnTransition implements EventSubscriberInterface { - public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EngineInterface $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Security $security, private readonly Registry $registry) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Security $security, private readonly Registry $registry) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php index adf19fb92..a4e8c6b78 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php @@ -21,7 +21,7 @@ use Symfony\Component\Workflow\Registry; class SendAccessKeyEventSubscriber { - public function __construct(private readonly EngineInterface $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MailerInterface $mailer) + public function __construct(private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MailerInterface $mailer) { } diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php index ce26780a4..c532b5553 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php @@ -24,7 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PersonAddressMoveEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly EngineInterface $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) + public function __construct(private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php index b8ca31835..9e725b22c 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php @@ -24,7 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserRefEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly EngineInterface $engine, private readonly NotificationPersisterInterface $notificationPersister) + public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister) { } diff --git a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php index 4817e3819..d587a55e5 100644 --- a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php @@ -63,7 +63,7 @@ final class ChillPersonMoveCommand extends Command ->addOption('delete-entity', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'entity to delete', []); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $repository = $this->em->getRepository(Person::class); $from = $repository->find($input->getOption('from')); @@ -100,6 +100,7 @@ final class ChillPersonMoveCommand extends Command $this->chillLogger->notice('Move a person from command line succeeded', $ctxt); } + return 0; } protected function interact(InputInterface $input, OutputInterface $output) diff --git a/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php index 643e176c4..8e4009364 100644 --- a/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php @@ -41,7 +41,7 @@ final class ImportSocialWorkMetadata extends Command ->addOption('language', 'l', InputOption::VALUE_OPTIONAL, 'The default language'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $filepath = $input->getOption('filepath'); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php index 5ce844a90..3a12cc514 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php @@ -32,7 +32,7 @@ use Symfony\Component\Templating\EngineInterface; class AccompanyingPeriodRegulationListController { - public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly EngineInterface $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php index 01810feeb..ad4743921 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php @@ -36,7 +36,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class HouseholdCompositionController extends AbstractController { - public function __construct(private readonly Security $security, private readonly HouseholdCompositionRepository $householdCompositionRepository, private readonly HouseholdRepository $householdRepository, private readonly PaginatorFactory $paginatorFactory, private readonly FormFactoryInterface $formFactory, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly EngineInterface $engine, private readonly UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly Security $security, private readonly HouseholdCompositionRepository $householdCompositionRepository, private readonly HouseholdRepository $householdRepository, private readonly PaginatorFactory $paginatorFactory, private readonly FormFactoryInterface $formFactory, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index 6bfd7ac86..404082630 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -40,7 +40,7 @@ use function is_int; class ReassignAccompanyingPeriodController extends AbstractController { - public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly EngineInterface $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index 7024e732b..ddf6a7d9c 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -42,7 +42,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface public function load(ObjectManager $manager): void { - return; + /** @var array> $existing */ $existing = []; for ($i = 0; 20 > $i; ++$i) { @@ -60,15 +60,16 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface ->setUpdatedAt($date); // remove the potential duplicates - $set = $relationship->getFromPerson()->getId() < $relationship->getToPerson()->getId() ? - [$relationship->getFromPerson()->getId(), $relationship->getToPerson()->getId()] : - [$relationship->getToPerson()->getId(), $relationship->getFromPerson()->getId()]; + $set = [ + min($relationship->getFromPerson()->getId(), $relationship->getToPerson()->getId()), + max($relationship->getFromPerson()->getId(), $relationship->getToPerson()->getId()), + ]; if (array_key_exists($set[0], $existing) && array_key_exists($set[1], $existing[$set[0]])) { continue; } + $existing[$set[0]][$set[1]] = 1; - $existing[$set[0]][$existing[$set[1]]] = 1; $manager->persist($relationship); } diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 205023f19..c5a324855 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -45,7 +45,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf 'birthdate-after', 'gender', 'nationality', 'phonenumber', 'city', ]; - public function __construct(private readonly EngineInterface $templating, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private readonly PaginatorFactory $paginatorFactory, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository) + public function __construct(private readonly \Twig\Environment $templating, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private readonly PaginatorFactory $paginatorFactory, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index c41a94779..1c3ff56cd 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -28,7 +28,7 @@ class PersonRender implements PersonRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(private readonly ConfigPersonAltNamesHelper $configAltNamesHelper, private readonly EngineInterface $engine, private readonly TranslatorInterface $translator) + public function __construct(private readonly ConfigPersonAltNamesHelper $configAltNamesHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php index e4253f52e..c2d91483f 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php @@ -47,7 +47,7 @@ class SocialActionRender implements ChillEntityRenderInterface */ final public const SHOW_AND_CHILDREN = 'show_and_children'; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EngineInterface $engine, private readonly TranslatorInterface $translator) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php index f815afc43..79a8c62c4 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php @@ -40,7 +40,7 @@ final readonly class SocialIssueRender implements ChillEntityRenderInterface */ public const SHOW_AND_CHILDREN = 'show_and_children'; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private EngineInterface $engine, private TranslatorInterface $translator) + public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine, private TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php index 4f9977b6d..e7fa379f6 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php @@ -247,7 +247,7 @@ final class PersonMoveEventSubscriberTest extends KernelTestCase } private function buildSubscriber( - ?EngineInterface $engine = null, + ?\Twig\Environment $engine = null, ?NotificationPersisterInterface $notificationPersister = null, ?Security $security = null, ?TranslatorInterface $translator = null @@ -264,7 +264,7 @@ final class PersonMoveEventSubscriberTest extends KernelTestCase } if (null === $engine) { - $double = $this->prophesize(EngineInterface::class); + $double = $this->prophesize(\Twig\Environment::class); $engine = $double->reveal(); } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 565266a5e..6dc3c9b8c 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -200,23 +200,21 @@ class LoadReports extends AbstractFixture implements ContainerAwareInterface, Or } return $picked; - } else { - $picked = $this->pickChoice($choices); + } + $picked = $this->pickChoice($choices); - if ($other) { - $result = ['_other' => null, '_choices' => $picked]; + if ($other) { + $result = ['_other' => null, '_choices' => $picked]; - if ('_other' === $picked) { - $result['_other'] = $this->faker->realText(70); - } - - return $result; + if ('_other' === $picked) { + $result['_other'] = $this->faker->realText(70); } - return $picked; + return $result; } - throw new \LogicException("should not happens"); + return $picked; + } /** @@ -231,10 +229,8 @@ class LoadReports extends AbstractFixture implements ContainerAwareInterface, Or /** * pick a choice within a 'choices' options (for choice type). - * - * @return the slug of the selected choice */ - private function pickChoice(array $choices) + private function pickChoice(array $choices): string { return $choices[array_rand($choices)]['slug']; } diff --git a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php index 4432c5045..6e0e80093 100644 --- a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php +++ b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php @@ -25,7 +25,7 @@ class ThirdPartyRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(protected EngineInterface $engine, protected TranslatableStringHelper $translatableStringHelper) + public function __construct(protected \Twig\Environment $engine, protected TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Editor.php b/src/Bundle/ChillWopiBundle/src/Controller/Editor.php index 7280e7fca..dc3f32646 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Editor.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Editor.php @@ -38,7 +38,7 @@ use Twig\Environment; */ final readonly class Editor { - public function __construct(private ConfigurationInterface $wopiConfiguration, private DiscoveryInterface $wopiDiscovery, private DocumentManagerInterface $documentManager, private EngineInterface $engine, private JWTTokenManagerInterface $JWTTokenManager, private NormalizerInterface $normalizer, private ResponderInterface $responder, private Security $security, private Psr17Interface $psr17, private RouterInterface $router) + public function __construct(private ConfigurationInterface $wopiConfiguration, private DiscoveryInterface $wopiDiscovery, private DocumentManagerInterface $documentManager, private \Twig\Environment $engine, private JWTTokenManagerInterface $JWTTokenManager, private NormalizerInterface $normalizer, private ResponderInterface $responder, private Security $security, private Psr17Interface $psr17, private RouterInterface $router) { }