mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: rector apply rules 'symfony up to 4.4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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('<info>' . $num . ' were added !</info>');
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function addPostalCode($row, OutputInterface $output)
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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');
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user