aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/RegionBundle.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/RegionBundle.php')
-rw-r--r--vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/RegionBundle.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/RegionBundle.php b/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/RegionBundle.php
new file mode 100644
index 00000000..a3cd9bd3
--- /dev/null
+++ b/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/RegionBundle.php
@@ -0,0 +1,52 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Intl\ResourceBundle;
13
14/**
15 * Default implementation of {@link RegionBundleInterface}.
16 *
17 * @author Bernhard Schussek <bschussek@gmail.com>
18 */
19class RegionBundle extends AbstractBundle implements RegionBundleInterface
20{
21 /**
22 * {@inheritdoc}
23 */
24 public function getCountryName($country, $locale = null)
25 {
26 if (null === $locale) {
27 $locale = \Locale::getDefault();
28 }
29
30 return $this->readEntry($locale, array('Countries', $country));
31 }
32
33 /**
34 * {@inheritdoc}
35 */
36 public function getCountryNames($locale = null)
37 {
38 if (null === $locale) {
39 $locale = \Locale::getDefault();
40 }
41
42 if (null === ($countries = $this->readEntry($locale, array('Countries')))) {
43 return array();
44 }
45
46 if ($countries instanceof \Traversable) {
47 $countries = iterator_to_array($countries);
48 }
49
50 return $countries;
51 }
52}