From f835a7de0c0f65ddec522d8fe214ea9bc000c519 Mon Sep 17 00:00:00 2001 From: David ALLIX Date: Wed, 3 Jan 2024 12:21:54 +0100 Subject: [PATCH] Fix --- composer.json | 2 +- src/Locale/SimpleProvider.php | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 32745dd..46e098b 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "psalm" ], "phpunit": [ - "SYMFONY_DEPRECATIONS_HELPER=max[self]=0 SYMFONY_PHPUNIT_VERSION=9.6 simple-phpunit" + "SYMFONY_DEPRECATIONS_HELPER=max[self]=0 simple-phpunit" ] }, "config": { diff --git a/src/Locale/SimpleProvider.php b/src/Locale/SimpleProvider.php index 6e1d55a..d25f881 100644 --- a/src/Locale/SimpleProvider.php +++ b/src/Locale/SimpleProvider.php @@ -15,17 +15,11 @@ class SimpleProvider implements LocaleProviderInterface { - /** @var array */ - protected $locales; - - /** @var string */ - protected $defaultLocale; - - /** @var array */ - protected $requiredLocales; - - public function __construct(array $locales, string $defaultLocale, array $requiredLocales = []) - { + public function __construct( + private array $locales, + private string $defaultLocale, + private array $requiredLocales = [], + ) { if (!\in_array($defaultLocale, $locales, true)) { if (\count($locales)) { throw new \InvalidArgumentException(sprintf('Default locale `%s` not found within the configured locales `[%s]`. Perhaps you need to add it to your `a2lix_translation_form.locales` bundle configuration?', $defaultLocale, implode(',', $locales)));