From 4f5b44bd3bd490309eb2ba7b44df4769816ba729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 3 Aug 2013 19:26:54 +0200 Subject: twig implementation --- .../Intl/ResourceBundle/AbstractBundle.php | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/AbstractBundle.php (limited to 'vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/AbstractBundle.php') diff --git a/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/AbstractBundle.php b/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/AbstractBundle.php new file mode 100644 index 00000000..d1d523c4 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/AbstractBundle.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Intl\ResourceBundle; + +use Symfony\Component\Intl\Intl; +use Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface; + +/** + * Base class for {@link ResourceBundleInterface} implementations. + * + * @author Bernhard Schussek + */ +abstract class AbstractBundle implements ResourceBundleInterface +{ + /** + * @var string + */ + private $path; + + /** + * @var StructuredBundleReaderInterface + */ + private $reader; + + /** + * Creates a bundle at the given path using the given reader for reading + * bundle entries. + * + * @param string $path The path to the bundle. + * @param StructuredBundleReaderInterface $reader The reader for reading + * the bundle. + */ + public function __construct($path, StructuredBundleReaderInterface $reader) + { + $this->path = $path; + $this->reader = $reader; + } + + /** + * {@inheritdoc} + */ + public function getLocales() + { + return $this->reader->getLocales($this->path); + } + + /** + * Proxy method for {@link StructuredBundleReaderInterface#read}. + */ + protected function read($locale) + { + return $this->reader->read($this->path, $locale); + } + + /** + * Proxy method for {@link StructuredBundleReaderInterface#readEntry}. + */ + protected function readEntry($locale, array $indices, $mergeFallback = false) + { + return $this->reader->readEntry($this->path, $locale, $indices, $mergeFallback); + } +} -- cgit v1.2.3