Fix the return value on error for intl methods returning arrays
When the resource is missing, an empty array should be returned rather than null to respect the interface saying an array is always returned.
This commit is contained in:
parent
6b02601e7b
commit
801e5e2805
@ -76,7 +76,7 @@ class CurrencyBundle extends CurrencyDataProvider implements CurrencyBundleInter
|
|||||||
try {
|
try {
|
||||||
return $this->getNames($displayLocale);
|
return $this->getNames($displayLocale);
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class CurrencyBundle extends CurrencyDataProvider implements CurrencyBundleInter
|
|||||||
try {
|
try {
|
||||||
return $this->localeProvider->getLocales();
|
return $this->localeProvider->getLocales();
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInter
|
|||||||
try {
|
try {
|
||||||
return $this->getNames($displayLocale);
|
return $this->getNames($displayLocale);
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInter
|
|||||||
try {
|
try {
|
||||||
return $this->scriptProvider->getNames($displayLocale);
|
return $this->scriptProvider->getNames($displayLocale);
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInter
|
|||||||
try {
|
try {
|
||||||
return $this->localeProvider->getLocales();
|
return $this->localeProvider->getLocales();
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class LocaleBundle extends LocaleDataProvider implements LocaleBundleInterface
|
|||||||
try {
|
try {
|
||||||
return parent::getLocales();
|
return parent::getLocales();
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ class LocaleBundle extends LocaleDataProvider implements LocaleBundleInterface
|
|||||||
try {
|
try {
|
||||||
return $this->getNames($displayLocale);
|
return $this->getNames($displayLocale);
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ class RegionBundle extends RegionDataProvider implements RegionBundleInterface
|
|||||||
try {
|
try {
|
||||||
return $this->getNames($displayLocale);
|
return $this->getNames($displayLocale);
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class RegionBundle extends RegionDataProvider implements RegionBundleInterface
|
|||||||
try {
|
try {
|
||||||
return $this->localeProvider->getLocales();
|
return $this->localeProvider->getLocales();
|
||||||
} catch (MissingResourceException $e) {
|
} catch (MissingResourceException $e) {
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user