Skip to content

Commit 0686378

Browse files
committed
bug symfony#24694 [Intl] Allow passing null as a locale fallback (jakzal)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Intl] Allow passing null as a locale fallback | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - [`Null` is passed in `update-data.php`](https://github.com/symfony/symfony/blob/e2b4a35a720b85173d15055d0554f86602d43593/src/Symfony/Component/Intl/Resources/bin/update-data.php#L209) to prevent falling back to English locale during icu data import. It's been always possible, but since it hasn't been documented in the docblock it was missed while merging symfony#23262. Commits ------- e2b4a35 [Intl] Allow passing null as a locale fallback
2 parents 64bed1b + e2b4a35 commit 0686378

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Intl/Locale.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
final class Locale extends \Locale
2222
{
2323
/**
24-
* @var string
24+
* @var string|null
2525
*/
2626
private static $defaultFallback = 'en';
2727

@@ -31,24 +31,24 @@ final class Locale extends \Locale
3131
* The default fallback locale is used as fallback for locales that have no
3232
* fallback otherwise.
3333
*
34-
* @param string $locale The default fallback locale
34+
* @param string|null $locale The default fallback locale
3535
*
3636
* @see getFallback()
3737
*/
38-
public static function setDefaultFallback(string $locale)
38+
public static function setDefaultFallback(?string $locale)
3939
{
4040
self::$defaultFallback = $locale;
4141
}
4242

4343
/**
4444
* Returns the default fallback locale.
4545
*
46-
* @return string The default fallback locale
46+
* @return string|null The default fallback locale
4747
*
4848
* @see setDefaultFallback()
4949
* @see getFallback()
5050
*/
51-
public static function getDefaultFallback(): string
51+
public static function getDefaultFallback(): ?string
5252
{
5353
return self::$defaultFallback;
5454
}

0 commit comments

Comments
 (0)