Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

vendor/symfony/intl/Locales.php line 70

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Intl;
  11. use Symfony\Component\Intl\Exception\MissingResourceException;
  12. /**
  13.  * Gives access to locale-related ICU data.
  14.  *
  15.  * @author Bernhard Schussek <bschussek@gmail.com>
  16.  * @author Roland Franssen <franssen.roland@gmail.com>
  17.  */
  18. final class Locales extends ResourceBundle
  19. {
  20.     /**
  21.      * @return string[]
  22.      */
  23.     public static function getLocales(): array
  24.     {
  25.         return self::readEntry(['Locales'], 'meta');
  26.     }
  27.     /**
  28.      * @return string[]
  29.      */
  30.     public static function getAliases(): array
  31.     {
  32.         return self::readEntry(['Aliases'], 'meta');
  33.     }
  34.     public static function exists(string $locale): bool
  35.     {
  36.         try {
  37.             self::readEntry(['Names'$locale]);
  38.             return true;
  39.         } catch (MissingResourceException $e) {
  40.             return \in_array($localeself::getAliases(), true);
  41.         }
  42.     }
  43.     /**
  44.      * @throws MissingResourceException if the locale does not exist
  45.      */
  46.     public static function getName(string $localestring $displayLocale null): string
  47.     {
  48.         try {
  49.             return self::readEntry(['Names'$locale], $displayLocale);
  50.         } catch (MissingResourceException $e) {
  51.             if (false === $aliased array_search($localeself::getAliases(), true)) {
  52.                 throw $e;
  53.             }
  54.             return self::readEntry(['Names'$aliased], $displayLocale);
  55.         }
  56.     }
  57.     /**
  58.      * @return string[]
  59.      */
  60.     public static function getNames(string $displayLocale null): array
  61.     {
  62.         return self::asort(self::readEntry(['Names'], $displayLocale), $displayLocale);
  63.     }
  64.     protected static function getPath(): string
  65.     {
  66.         return Intl::getDataDirectory().'/'.Intl::LOCALE_DIR;
  67.     }
  68. }