Преглед изворни кода

Merge remote branch 'DerekRoth/patch-1'

* DerekRoth/patch-1:
  A constructor returning null is counter-intuitive. BTW, isn't this a intl bug ?
Fabien Potencier пре 14 година
родитељ
комит
78b91a017e
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/Symfony/Component/Locale/Locale.php

+ 3 - 3
src/Symfony/Component/Locale/Locale.php

@@ -41,7 +41,7 @@ class Locale extends \Locale
     static public function getDisplayCountries($locale)
     static public function getDisplayCountries($locale)
     {
     {
         if (!isset(self::$countries[$locale])) {
         if (!isset(self::$countries[$locale])) {
-            $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/region');
+            $bundle = \ResourceBundle::create($locale, __DIR__.'/Resources/data/region');
 
 
             if (null === $bundle) {
             if (null === $bundle) {
                 throw new \RuntimeException('The country resource bundle could not be loaded');
                 throw new \RuntimeException('The country resource bundle could not be loaded');
@@ -88,7 +88,7 @@ class Locale extends \Locale
     static public function getDisplayLanguages($locale)
     static public function getDisplayLanguages($locale)
     {
     {
         if (!isset(self::$languages[$locale])) {
         if (!isset(self::$languages[$locale])) {
-            $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/lang');
+            $bundle = \ResourceBundle::create($locale, __DIR__.'/Resources/data/lang');
 
 
             if (null === $bundle) {
             if (null === $bundle) {
                 throw new \RuntimeException('The language resource bundle could not be loaded');
                 throw new \RuntimeException('The language resource bundle could not be loaded');
@@ -133,7 +133,7 @@ class Locale extends \Locale
     static public function getDisplayLocales($locale)
     static public function getDisplayLocales($locale)
     {
     {
         if (!isset(self::$locales[$locale])) {
         if (!isset(self::$locales[$locale])) {
-            $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/names');
+            $bundle = \ResourceBundle::create($locale, __DIR__.'/Resources/data/names');
 
 
             if (null === $bundle) {
             if (null === $bundle) {
                 throw new \RuntimeException('The locale resource bundle could not be loaded');
                 throw new \RuntimeException('The locale resource bundle could not be loaded');