From 7e194198616f08670202002c7c8a3842d86e3351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 28 Apr 2023 23:03:36 +0200 Subject: [PATCH] fixes for last rebase and fixes for runtime --- .../CustomFieldsGroupController.php | 4 +-- .../Config/ConfigRepository.php | 4 +-- .../Controller/FamilyMemberController.php | 11 ++---- .../ChillMainExtension.php | 2 +- .../ChillMainBundle/Notification/Mailer.php | 34 ++----------------- .../PasswordRecover/RecoverPasswordHelper.php | 22 ++---------- .../Resolver/ScopeResolverDispatcher.php | 2 +- .../Controller/SingleTaskController.php | 1 - 8 files changed, 11 insertions(+), 69 deletions(-) diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index 68ccb9904..2ae552b01 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -36,7 +36,7 @@ class CustomFieldsGroupController extends AbstractController /** * CustomFieldsGroupController constructor. */ - public function __construct(private CustomFieldProvider $customfieldProvider, private TranslatorInterface $translator) + public function __construct(private CustomFieldProvider $customFieldProvider, private TranslatorInterface $translator) { } @@ -283,7 +283,7 @@ class CustomFieldsGroupController extends AbstractController { $fieldChoices = []; - foreach ($this->customfieldProvider->getAllFields() + foreach ($this->customFieldProvider->getAllFields() as $key => $customType) { $fieldChoices[$key] = $customType->getName(); } diff --git a/src/Bundle/ChillFamilyMembersBundle/Config/ConfigRepository.php b/src/Bundle/ChillFamilyMembersBundle/Config/ConfigRepository.php index c361984f0..7fc9c6c47 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Config/ConfigRepository.php +++ b/src/Bundle/ChillFamilyMembersBundle/Config/ConfigRepository.php @@ -27,10 +27,8 @@ class ConfigRepository /** * @param mixed[] $links - * @param mixed $professionnalSituations - * @param mixed $familialSituations */ - public function __construct(protected $links, $professionnalSituations, $familialSituations) + public function __construct(protected $links, mixed $professionnalSituations, mixed $familialSituations) { $this->professionalSituations = $professionnalSituations ?? []; $this->familialSituations = $familialSituations ?? []; diff --git a/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php b/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php index 5892ddbc4..34a83dfcb 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php +++ b/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php @@ -28,15 +28,8 @@ use Symfony\Contracts\Translation\TranslatorInterface; class FamilyMemberController extends AbstractController { - private FamilyMemberRepository $familyMemberRepository; - - public function __construct( - private EntityManagerInterface $em, - protected TranslatorInterface $translator, - protected LoggerInterface $chillMainLogger, - FamilyMemberRepository $familyMemberRepository - ) { - $this->familyMemberRepository = $familyMemberRepository; + public function __construct(private EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger, private FamilyMemberRepository $familyMemberRepository) + { } /** diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 2da35e7ef..dd74b2c09 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -93,7 +93,7 @@ class ChillMainExtension extends Extension implements $this->widgetFactories[] = $factory; } - public function getConfiguration(array $config, ContainerBuilder $container): \Chill\MainBundle\DependencyInjection\Configuration|object|\Symfony\Component\Config\Definition\ConfigurationInterface|null + public function getConfiguration(array $config, ContainerBuilder $container): \Chill\MainBundle\DependencyInjection\Configuration { return new Configuration($this->widgetFactories, $container); } diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index d0a449787..b65d29c8d 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -34,44 +34,14 @@ use function call_user_func; */ class Mailer { - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var RouterInterface - */ - private $router; - - /** - * @var TranslatorInterface - */ - private $translator; - - private EngineInterface $twig; - - private MailerInterface $mailer; - /** * Mailer constructor. * * @param $routeParameters * @param mixed[] $routeParameters */ - public function __construct( - MailerInterface $mailer, - LoggerInterface $logger, - EngineInterface $twig, - RouterInterface $router, - TranslatorInterface $translator, - protected $routeParameters - ) { - $this->logger = $logger; - $this->twig = $twig; - $this->mailer = $mailer; - $this->router = $router; - $this->translator = $translator; + public function __construct(private MailerInterface $mailer, private LoggerInterface $logger, private EngineInterface $twig, private RouterInterface $router, private TranslatorInterface $translator, protected $routeParameters) + { } /** diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php index 42881e291..4598f6199 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php @@ -24,26 +24,8 @@ class RecoverPasswordHelper { public const RECOVER_PASSWORD_ROUTE = 'password_recover'; - private MailerInterface $mailer; - - /** - * @var TokenManager - */ - private $tokenManager; - - /** - * @var UrlGeneratorInterface - */ - private $urlGenerator; - - public function __construct( - TokenManager $tokenManager, - UrlGeneratorInterface $urlGenerator, - MailerInterface $mailer, - ) { - $this->tokenManager = $tokenManager; - $this->urlGenerator = $urlGenerator; - $this->mailer = $mailer; + public function __construct(private TokenManager $tokenManager, private UrlGeneratorInterface $urlGenerator, private MailerInterface $mailer) + { } /** diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php index 1c40ad282..151754ae7 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php @@ -39,7 +39,7 @@ final class ScopeResolverDispatcher * * @return iterable|Scope|Scope[] */ - public function resolveScope($entity, ?array $options = []): iterable|\Chill\MainBundle\Entity\Scope|array + public function resolveScope($entity, ?array $options = []): iterable|\Chill\MainBundle\Entity\Scope { foreach ($this->resolvers as $resolver) { if ($resolver->supports($entity, $options)) { diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index ec523ad43..a1085657a 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -646,7 +646,6 @@ final class SingleTaskController extends AbstractController /** * Creates a form to delete a Task entity by id. - * @param mixed $id */ private function createDeleteForm(mixed $id): FormInterface {