Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
webda2l committed Jan 3, 2024
1 parent d1c228a commit f835a7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
16 changes: 5 additions & 11 deletions src/Locale/SimpleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit f835a7d

Please sign in to comment.