Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70a941e

Browse files
committed
[Intl] Cleanup
1 parent15e9eec commit70a941e

14 files changed

+43
-175
lines changed

‎src/Symfony/Component/Intl/CONTRIBUTING.md‎

Lines changed: 0 additions & 91 deletions
This file was deleted.

‎src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php‎

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,20 @@
2525
*/
2626
class CurrencyDataGeneratorextends AbstractDataGenerator
2727
{
28-
constUNKNOWN_CURRENCY_ID ='XXX';
29-
constEUROPEAN_COMPOSITE_UNIT_ID ='XBA';
30-
constEUROPEAN_MONETARY_UNIT_ID ='XBB';
31-
constEUROPEAN_UNIT_OF_ACCOUNT_XBC_ID ='XBC';
32-
constEUROPEAN_UNIT_OF_ACCOUNT_XBD_ID ='XBD';
33-
constTESTING_CURRENCY_CODE_ID ='XTS';
34-
constADB_UNIT_OF_ACCOUNT_ID ='XUA';
35-
constGOLD_ID ='XAU';
36-
constSILVER_ID ='XAG';
37-
constPLATINUM_ID ='XPT';
38-
constPALLADIUM_ID ='XPD';
39-
constSUCRE_ID ='XSU';
40-
constSPECIAL_DRAWING_RIGHTS_ID ='XDR';
41-
42-
/**
43-
* Monetary units excluded from generation.
44-
*/
4528
privatestatic$blacklist = [
46-
self::UNKNOWN_CURRENCY_ID =>true,
47-
self::EUROPEAN_COMPOSITE_UNIT_ID =>true,
48-
self::EUROPEAN_MONETARY_UNIT_ID =>true,
49-
self::EUROPEAN_UNIT_OF_ACCOUNT_XBC_ID =>true,
50-
self::EUROPEAN_UNIT_OF_ACCOUNT_XBD_ID =>true,
51-
self::TESTING_CURRENCY_CODE_ID =>true,
52-
self::ADB_UNIT_OF_ACCOUNT_ID =>true,
53-
self::GOLD_ID =>true,
54-
self::SILVER_ID =>true,
55-
self::PLATINUM_ID =>true,
56-
self::PALLADIUM_ID =>true,
57-
self::SUCRE_ID =>true,
58-
self::SPECIAL_DRAWING_RIGHTS_ID =>true,
29+
'XBA' =>true,// European Composite Unit
30+
'XBB' =>true,// European Monetary Unit
31+
'XBC' =>true,// European Unit of Account (XBC)
32+
'XBD' =>true,// European Unit of Account (XBD)
33+
'XUA' =>true,// ADB Unit of Account
34+
'XAU' =>true,// Gold
35+
'XAG' =>true,// Silver
36+
'XPT' =>true,// Platinum
37+
'XPD' =>true,// Palladium
38+
'XSU' =>true,// Sucre
39+
'XDR' =>true,// Special Drawing Rights
40+
'XTS' =>true,// Testing Currency Code
41+
'XXX' =>true,// Unknown Currency
5942
];
6043

6144
/**

‎src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php‎

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,18 @@
2727
*/
2828
class RegionDataGeneratorextends AbstractDataGenerator
2929
{
30-
constUNKNOWN_REGION_ID ='ZZ';
31-
constOUTLYING_OCEANIA_REGION_ID ='QO';
32-
constEUROPEAN_UNION_ID ='EU';
33-
constNETHERLANDS_ANTILLES_ID ='AN';
34-
constBOUVET_ISLAND_ID ='BV';
35-
constHEARD_MCDONALD_ISLANDS_ID ='HM';
36-
constCLIPPERTON_ISLAND_ID ='CP';
37-
constEUROZONE_ID ='EZ';
38-
constUNITED_NATIONS_ID ='UN';
39-
40-
/**
41-
* Regions excluded from generation.
42-
*/
4330
privatestatic$blacklist = [
44-
self::UNKNOWN_REGION_ID =>true,
4531
// Look like countries, but are sub-continents
46-
self::OUTLYING_OCEANIA_REGION_ID =>true,
47-
self::EUROPEAN_UNION_ID =>true,
48-
self::EUROZONE_ID =>true,
49-
self::UNITED_NATIONS_ID =>true,
50-
// No longer exists
51-
self::NETHERLANDS_ANTILLES_ID =>true,
32+
'QO' =>true,// Outlying Oceania
33+
'EU' =>true,// European Union
34+
'EZ' =>true,// Eurozone
35+
'UN' =>true,// United Nations
5236
// Uninhabited islands
53-
self::BOUVET_ISLAND_ID =>true,
54-
self::HEARD_MCDONALD_ISLANDS_ID =>true,
55-
self::CLIPPERTON_ISLAND_ID =>true,
37+
'BV' =>true,// Bouvet Island
38+
'HM' =>true,// Heard & McDonald Islands
39+
'CP' =>true,// Clipperton Island
40+
// Misc
41+
'ZZ' =>true,// Unknown Region
5642
];
5743

5844
/**

‎src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
useSymfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
1515
useSymfony\Component\Intl\Exception\MissingResourceException;
16-
useSymfony\Component\Intl\Locale;
1716

1817
/**
1918
* Data provider for currency-related data.
@@ -53,7 +52,7 @@ public function getCurrencies()
5352
publicfunctiongetSymbol($currency,$displayLocale =null)
5453
{
5554
if (null ===$displayLocale) {
56-
$displayLocale = Locale::getDefault();
55+
$displayLocale =\Locale::getDefault();
5756
}
5857

5958
return$this->reader->readEntry($this->path,$displayLocale, ['Names',$currency,static::INDEX_SYMBOL]);
@@ -62,7 +61,7 @@ public function getSymbol($currency, $displayLocale = null)
6261
publicfunctiongetName($currency,$displayLocale =null)
6362
{
6463
if (null ===$displayLocale) {
65-
$displayLocale = Locale::getDefault();
64+
$displayLocale =\Locale::getDefault();
6665
}
6766

6867
return$this->reader->readEntry($this->path,$displayLocale, ['Names',$currency,static::INDEX_NAME]);
@@ -71,7 +70,7 @@ public function getName($currency, $displayLocale = null)
7170
publicfunctiongetNames($displayLocale =null)
7271
{
7372
if (null ===$displayLocale) {
74-
$displayLocale = Locale::getDefault();
73+
$displayLocale =\Locale::getDefault();
7574
}
7675

7776
// ====================================================================

‎src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Intl\Data\Provider;
1313

1414
useSymfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
15-
useSymfony\Component\Intl\Locale;
1615

1716
/**
1817
* Data provider for language-related ICU data.
@@ -51,7 +50,7 @@ public function getAliases()
5150
publicfunctiongetName($language,$displayLocale =null)
5251
{
5352
if (null ===$displayLocale) {
54-
$displayLocale = Locale::getDefault();
53+
$displayLocale =\Locale::getDefault();
5554
}
5655

5756
return$this->reader->readEntry($this->path,$displayLocale, ['Names',$language]);
@@ -60,7 +59,7 @@ public function getName($language, $displayLocale = null)
6059
publicfunctiongetNames($displayLocale =null)
6160
{
6261
if (null ===$displayLocale) {
63-
$displayLocale = Locale::getDefault();
62+
$displayLocale =\Locale::getDefault();
6463
}
6564

6665
$languages =$this->reader->readEntry($this->path,$displayLocale, ['Names']);

‎src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Intl\Data\Provider;
1313

1414
useSymfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
15-
useSymfony\Component\Intl\Locale;
1615

1716
/**
1817
* Data provider for locale-related ICU data.
@@ -57,7 +56,7 @@ public function getAliases()
5756
publicfunctiongetName($locale,$displayLocale =null)
5857
{
5958
if (null ===$displayLocale) {
60-
$displayLocale = Locale::getDefault();
59+
$displayLocale =\Locale::getDefault();
6160
}
6261

6362
return$this->reader->readEntry($this->path,$displayLocale, ['Names',$locale]);
@@ -66,7 +65,7 @@ public function getName($locale, $displayLocale = null)
6665
publicfunctiongetNames($displayLocale =null)
6766
{
6867
if (null ===$displayLocale) {
69-
$displayLocale = Locale::getDefault();
68+
$displayLocale =\Locale::getDefault();
7069
}
7170

7271
$names =$this->reader->readEntry($this->path,$displayLocale, ['Names']);

‎src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Intl\Data\Provider;
1313

1414
useSymfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
15-
useSymfony\Component\Intl\Locale;
1615

1716
/**
1817
* Data provider for region-related ICU data.
@@ -46,7 +45,7 @@ public function getRegions()
4645
publicfunctiongetName($region,$displayLocale =null)
4746
{
4847
if (null ===$displayLocale) {
49-
$displayLocale = Locale::getDefault();
48+
$displayLocale =\Locale::getDefault();
5049
}
5150

5251
return$this->reader->readEntry($this->path,$displayLocale, ['Names',$region]);
@@ -55,7 +54,7 @@ public function getName($region, $displayLocale = null)
5554
publicfunctiongetNames($displayLocale =null)
5655
{
5756
if (null ===$displayLocale) {
58-
$displayLocale = Locale::getDefault();
57+
$displayLocale =\Locale::getDefault();
5958
}
6059

6160
$names =$this->reader->readEntry($this->path,$displayLocale, ['Names']);

‎src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Intl\Data\Provider;
1313

1414
useSymfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
15-
useSymfony\Component\Intl\Locale;
1615

1716
/**
1817
* Data provider for script-related ICU data.
@@ -46,7 +45,7 @@ public function getScripts()
4645
publicfunctiongetName($script,$displayLocale =null)
4746
{
4847
if (null ===$displayLocale) {
49-
$displayLocale = Locale::getDefault();
48+
$displayLocale =\Locale::getDefault();
5049
}
5150

5251
return$this->reader->readEntry($this->path,$displayLocale, ['Names',$script]);
@@ -55,7 +54,7 @@ public function getName($script, $displayLocale = null)
5554
publicfunctiongetNames($displayLocale =null)
5655
{
5756
if (null ===$displayLocale) {
58-
$displayLocale = Locale::getDefault();
57+
$displayLocale =\Locale::getDefault();
5958
}
6059

6160
$names =$this->reader->readEntry($this->path,$displayLocale, ['Names']);

‎src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
useSymfony\Component\Intl\Data\Provider\CurrencyDataProvider;
1515
useSymfony\Component\Intl\Intl;
16-
useSymfony\Component\Intl\Locale;
1716

1817
/**
1918
* @author Bernhard Schussek <bschussek@gmail.com>
@@ -631,7 +630,7 @@ public function testGetNames($displayLocale)
631630

632631
publicfunctiontestGetNamesDefaultLocale()
633632
{
634-
Locale::setDefault('de_AT');
633+
\Locale::setDefault('de_AT');
635634

636635
$this->assertSame(
637636
$this->dataProvider->getNames('de_AT'),
@@ -670,7 +669,7 @@ public function testGetName($displayLocale)
670669

671670
publicfunctiontestGetNameDefaultLocale()
672671
{
673-
Locale::setDefault('de_AT');
672+
\Locale::setDefault('de_AT');
674673

675674
$expected =$this->dataProvider->getNames('de_AT');
676675
$actual = [];

‎src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ abstract class AbstractDataProviderTest extends TestCase
703703

704704
protectedfunctionsetUp()
705705
{
706-
Locale::setDefault('en');
706+
\Locale::setDefault('en');
707707
Locale::setDefaultFallback('en');
708708
}
709709

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp