diff --git a/src/Symfony/Component/Intl/CONTRIBUTING.md b/src/Symfony/Component/Intl/CONTRIBUTING.md deleted file mode 100644 index 971e0af7f5903..0000000000000 --- a/src/Symfony/Component/Intl/CONTRIBUTING.md +++ /dev/null @@ -1,91 +0,0 @@ -Contributing to the Intl component -================================== - -A very good way of contributing to the Intl component is by updating the -included data for the ICU version you have installed on your system. - -Preparation ------------ - -To prepare, you need to install the development dependencies of the component. - - $ cd /path/to/Symfony/Component/Intl - $ composer install - -Determining your ICU version ---------------------------- - -The ICU version installed in your PHP environment can be found by running -icu-version.php: - - $ php Resources/bin/icu-version.php - -Updating the ICU data ---------------------- - -To update the data files, run the update-icu-component.php script: - - $ php Resources/bin/update-icu-component.php - -The script needs the binaries "svn" and "make" to be available on your system. -It will download the latest version of the ICU sources for the ICU version -installed in your PHP environment. The script will then compile the "genrb" -binary and use it to compile the ICU data files to binaries. The binaries are -copied to the Resources/ directory of the Icu component found in the -vendor/symfony/icu/ directory. - -Updating the stub data ----------------------- - -In the previous step you updated the Icu component for the ICU version -installed on your system. If you are using the latest ICU version, you should -also create the stub data files which will be used by people who don't have -the intl extension installed. - -To update the stub files, run the update-stubs.php script: - - $ php Resources/bin/update-stubs.php - -The script will fail if you don't have the latest ICU version. If you want to -upgrade the ICU version, adjust the return value of the -`Intl::getIcuStubVersion()` before you run the script. - -The script creates copies of the binary resource bundles in the Icu component -and stores them in the Resources/ directory of the Intl component. The copies -are made for the locale "en" only and are stored in .php files, so that they -can be read even if the intl extension is not available. - -Creating a pull request ------------------------ - -You need to create up to two pull requests: - -* If you updated the Icu component, you need to push that change and create a - pull request in the `symfony/Icu` repository. Make sure to submit the pull - request to the correct master branch. If you updated the ICU data for version - 4.8, your pull request goes to branch `48-master`, for version 49 to - `49-master` and so on. - -* If you updated the stub files of the Intl component, you need to push that - change and create a pull request in the `symfony/symfony` repository. The - pull request should be based on the `master` branch. - -Combining .res files to a .dat-package --------------------------------------- - -The individual *.res files can be combined into a single .dat-file. -Unfortunately, PHP's `ResourceBundle` class is currently not able to handle -.dat-files. - -Once it is, the following steps have to be followed to build the .dat-file: - -1. Package the resource bundles into a single file - - $ find . -name *.res | sed -e "s/\.\///g" > packagelist.txt - $ pkgdata -p region -T build -d . packagelist.txt - -2. Clean up - - $ rm -rf build packagelist.txt - -3. You can now move region.dat to replace the version bundled with Symfony. diff --git a/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php index 1be618d7878d7..f64daf275aafa 100644 --- a/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php @@ -25,37 +25,20 @@ */ class CurrencyDataGenerator extends AbstractDataGenerator { - const UNKNOWN_CURRENCY_ID = 'XXX'; - const EUROPEAN_COMPOSITE_UNIT_ID = 'XBA'; - const EUROPEAN_MONETARY_UNIT_ID = 'XBB'; - const EUROPEAN_UNIT_OF_ACCOUNT_XBC_ID = 'XBC'; - const EUROPEAN_UNIT_OF_ACCOUNT_XBD_ID = 'XBD'; - const TESTING_CURRENCY_CODE_ID = 'XTS'; - const ADB_UNIT_OF_ACCOUNT_ID = 'XUA'; - const GOLD_ID = 'XAU'; - const SILVER_ID = 'XAG'; - const PLATINUM_ID = 'XPT'; - const PALLADIUM_ID = 'XPD'; - const SUCRE_ID = 'XSU'; - const SPECIAL_DRAWING_RIGHTS_ID = 'XDR'; - - /** - * Monetary units excluded from generation. - */ private static $blacklist = [ - self::UNKNOWN_CURRENCY_ID => true, - self::EUROPEAN_COMPOSITE_UNIT_ID => true, - self::EUROPEAN_MONETARY_UNIT_ID => true, - self::EUROPEAN_UNIT_OF_ACCOUNT_XBC_ID => true, - self::EUROPEAN_UNIT_OF_ACCOUNT_XBD_ID => true, - self::TESTING_CURRENCY_CODE_ID => true, - self::ADB_UNIT_OF_ACCOUNT_ID => true, - self::GOLD_ID => true, - self::SILVER_ID => true, - self::PLATINUM_ID => true, - self::PALLADIUM_ID => true, - self::SUCRE_ID => true, - self::SPECIAL_DRAWING_RIGHTS_ID => true, + 'XBA' => true, // European Composite Unit + 'XBB' => true, // European Monetary Unit + 'XBC' => true, // European Unit of Account (XBC) + 'XBD' => true, // European Unit of Account (XBD) + 'XUA' => true, // ADB Unit of Account + 'XAU' => true, // Gold + 'XAG' => true, // Silver + 'XPT' => true, // Platinum + 'XPD' => true, // Palladium + 'XSU' => true, // Sucre + 'XDR' => true, // Special Drawing Rights + 'XTS' => true, // Testing Currency Code + 'XXX' => true, // Unknown Currency ]; /** diff --git a/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php index 0728db80309b8..9524e18eafbf4 100644 --- a/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php @@ -27,32 +27,18 @@ */ class RegionDataGenerator extends AbstractDataGenerator { - const UNKNOWN_REGION_ID = 'ZZ'; - const OUTLYING_OCEANIA_REGION_ID = 'QO'; - const EUROPEAN_UNION_ID = 'EU'; - const NETHERLANDS_ANTILLES_ID = 'AN'; - const BOUVET_ISLAND_ID = 'BV'; - const HEARD_MCDONALD_ISLANDS_ID = 'HM'; - const CLIPPERTON_ISLAND_ID = 'CP'; - const EUROZONE_ID = 'EZ'; - const UNITED_NATIONS_ID = 'UN'; - - /** - * Regions excluded from generation. - */ private static $blacklist = [ - self::UNKNOWN_REGION_ID => true, // Look like countries, but are sub-continents - self::OUTLYING_OCEANIA_REGION_ID => true, - self::EUROPEAN_UNION_ID => true, - self::EUROZONE_ID => true, - self::UNITED_NATIONS_ID => true, - // No longer exists - self::NETHERLANDS_ANTILLES_ID => true, + 'QO' => true, // Outlying Oceania + 'EU' => true, // European Union + 'EZ' => true, // Eurozone + 'UN' => true, // United Nations // Uninhabited islands - self::BOUVET_ISLAND_ID => true, - self::HEARD_MCDONALD_ISLANDS_ID => true, - self::CLIPPERTON_ISLAND_ID => true, + 'BV' => true, // Bouvet Island + 'HM' => true, // Heard & McDonald Islands + 'CP' => true, // Clipperton Island + // Misc + 'ZZ' => true, // Unknown Region ]; /** diff --git a/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php index dacde26f83707..f31128535ed5d 100644 --- a/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php @@ -13,7 +13,6 @@ use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; use Symfony\Component\Intl\Exception\MissingResourceException; -use Symfony\Component\Intl\Locale; /** * Data provider for currency-related data. @@ -53,7 +52,7 @@ public function getCurrencies() public function getSymbol($currency, $displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, ['Names', $currency, static::INDEX_SYMBOL]); @@ -62,7 +61,7 @@ public function getSymbol($currency, $displayLocale = null) public function getName($currency, $displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, ['Names', $currency, static::INDEX_NAME]); @@ -71,7 +70,7 @@ public function getName($currency, $displayLocale = null) public function getNames($displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } // ==================================================================== diff --git a/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php index 2178158513e47..ba31087a10212 100644 --- a/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Intl\Data\Provider; use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; -use Symfony\Component\Intl\Locale; /** * Data provider for language-related ICU data. @@ -51,7 +50,7 @@ public function getAliases() public function getName($language, $displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, ['Names', $language]); @@ -60,7 +59,7 @@ public function getName($language, $displayLocale = null) public function getNames($displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } $languages = $this->reader->readEntry($this->path, $displayLocale, ['Names']); diff --git a/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php index 4328b57d2f09d..df00f64406ae1 100644 --- a/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Intl\Data\Provider; use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; -use Symfony\Component\Intl\Locale; /** * Data provider for locale-related ICU data. @@ -57,7 +56,7 @@ public function getAliases() public function getName($locale, $displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, ['Names', $locale]); @@ -66,7 +65,7 @@ public function getName($locale, $displayLocale = null) public function getNames($displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } $names = $this->reader->readEntry($this->path, $displayLocale, ['Names']); diff --git a/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php index 08bd724394d9a..c1ce805f1c154 100644 --- a/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Intl\Data\Provider; use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; -use Symfony\Component\Intl\Locale; /** * Data provider for region-related ICU data. @@ -46,7 +45,7 @@ public function getRegions() public function getName($region, $displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, ['Names', $region]); @@ -55,7 +54,7 @@ public function getName($region, $displayLocale = null) public function getNames($displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } $names = $this->reader->readEntry($this->path, $displayLocale, ['Names']); diff --git a/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php index c6844494a89f5..55cd862c5e07d 100644 --- a/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Intl\Data\Provider; use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; -use Symfony\Component\Intl\Locale; /** * Data provider for script-related ICU data. @@ -46,7 +45,7 @@ public function getScripts() public function getName($script, $displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, ['Names', $script]); @@ -55,7 +54,7 @@ public function getName($script, $displayLocale = null) public function getNames($displayLocale = null) { if (null === $displayLocale) { - $displayLocale = Locale::getDefault(); + $displayLocale = \Locale::getDefault(); } $names = $this->reader->readEntry($this->path, $displayLocale, ['Names']); diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php index 428f6f89b0045..4c566aed3cde4 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php @@ -13,7 +13,6 @@ use Symfony\Component\Intl\Data\Provider\CurrencyDataProvider; use Symfony\Component\Intl\Intl; -use Symfony\Component\Intl\Locale; /** * @author Bernhard Schussek @@ -631,7 +630,7 @@ public function testGetNames($displayLocale) public function testGetNamesDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $this->assertSame( $this->dataProvider->getNames('de_AT'), @@ -670,7 +669,7 @@ public function testGetName($displayLocale) public function testGetNameDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $expected = $this->dataProvider->getNames('de_AT'); $actual = []; diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php index d0ef4d273b45a..562f8386d1c9e 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php @@ -703,7 +703,7 @@ abstract class AbstractDataProviderTest extends TestCase protected function setUp() { - Locale::setDefault('en'); + \Locale::setDefault('en'); Locale::setDefaultFallback('en'); } diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php index 003e688d03d87..2b55349584a62 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php @@ -13,7 +13,6 @@ use Symfony\Component\Intl\Data\Provider\LanguageDataProvider; use Symfony\Component\Intl\Intl; -use Symfony\Component\Intl\Locale; /** * @author Bernhard Schussek @@ -865,7 +864,7 @@ public function testGetNames($displayLocale) public function testGetNamesDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $this->assertSame( $this->dataProvider->getNames('de_AT'), @@ -901,7 +900,7 @@ public function testGetName($displayLocale) public function testGetNameDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $names = $this->dataProvider->getNames('de_AT'); diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php index aeca40cdbd6cd..88242a6f9bcb3 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php @@ -13,7 +13,6 @@ use Symfony\Component\Intl\Data\Provider\LocaleDataProvider; use Symfony\Component\Intl\Intl; -use Symfony\Component\Intl\Locale; /** * @author Bernhard Schussek @@ -64,7 +63,7 @@ public function testGetNames($displayLocale) public function testGetNamesDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $this->assertSame( $this->dataProvider->getNames('de_AT'), @@ -100,7 +99,7 @@ public function testGetName($displayLocale) public function testGetNameDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $names = $this->dataProvider->getNames('de_AT'); diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php index 1f5febb2b86bf..aeb922f9e3e5f 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php @@ -13,7 +13,6 @@ use Symfony\Component\Intl\Data\Provider\RegionDataProvider; use Symfony\Component\Intl\Intl; -use Symfony\Component\Intl\Locale; /** * @author Bernhard Schussek @@ -316,7 +315,7 @@ public function testGetNames($displayLocale) public function testGetNamesDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $this->assertSame( $this->dataProvider->getNames('de_AT'), diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php index db4b81ebdb13f..8620fb2060fbc 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php @@ -13,7 +13,6 @@ use Symfony\Component\Intl\Data\Provider\ScriptDataProvider; use Symfony\Component\Intl\Intl; -use Symfony\Component\Intl\Locale; /** * @author Bernhard Schussek @@ -255,7 +254,7 @@ public function testGetNames($displayLocale) public function testGetNamesDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $this->assertSame( $this->dataProvider->getNames('de_AT'), @@ -291,7 +290,7 @@ public function testGetName($displayLocale) public function testGetNameDefaultLocale() { - Locale::setDefault('de_AT'); + \Locale::setDefault('de_AT'); $names = $this->dataProvider->getNames('de_AT'); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy