Source of file RegionBundleTransformationRule.php
Size: 1,713 Bytes - Last Modified: 2013-07-17T08:22:21+02:00
/home/theseer/Downloads/Symfony/vendor/symfony/symfony/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/RegionBundleTransformationRule.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 | <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\ResourceBundle\Transformer\Rule; use Symfony\Component\Intl\Intl; use Symfony\Component\Intl\ResourceBundle\Transformer\CompilationContextInterface; use Symfony\Component\Intl\ResourceBundle\Transformer\StubbingContextInterface; use Symfony\Component\Intl\Util\IcuVersion; /** * The rule for compiling the region bundle. * * @author Bernhard Schussek <bschussek@gmail.com> */ class RegionBundleTransformationRule implements TransformationRuleInterface { /** * {@inheritdoc} */ public function getBundleName() { return 'region'; } /** * {@inheritdoc} */ public function beforeCompile(CompilationContextInterface $context) { // The region data is contained in the locales bundle in ICU <= 4.2 if (IcuVersion::compare($context->getIcuVersion(), '4.2', '<=', 1)) { return $context->getSourceDir() . '/locales'; } return $context->getSourceDir() . '/region'; } /** * {@inheritdoc} */ public function afterCompile(CompilationContextInterface $context) { } /** * {@inheritdoc} */ public function beforeCreateStub(StubbingContextInterface $context) { return array( 'Countries' => Intl::getRegionBundle()->getCountryNames('en'), ); } /** * {@inheritdoc} */ public function afterCreateStub(StubbingContextInterface $context) { } } |