* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\ChoiceList\ArrayChoiceList; use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; use Symfony\Component\Intl\Intl; use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; class LocaleType extends AbstractType implements ChoiceLoaderInterface { /** * Locale loaded choice list. * * The choices are lazy loaded and generated from the Intl component. * * {@link \Symfony\Component\Intl\Intl::getLocaleBundle()}. * * @var ArrayChoiceList */ private $choiceList; /** * {@inheritdoc} */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'choice_loader' => function (Options $options) { if ($options['choices']) { @trigger_error(sprintf('Using the "choices" option in %s has been deprecated since Symfony 3.3 and will be ignored in 4.0. Override the "choice_loader" option instead or set it to null.', __CLASS__), E_USER_DEPRECATED); return null; } return $this; }, 'choice_translation_domain' => false, )); } /** * {@inheritdoc} */ public function getParent() { return __NAMESPACE__.'\ChoiceType'; } /** * {@inheritdoc} */ public function getBlockPrefix() { return 'locale'; } /** * {@inheritdoc} */ public function loadChoiceList($value = null) { if (null !== $this->choiceList) { return $this->choiceList; } return $this->choiceList = new ArrayChoiceList(array_flip(Intl::getLocaleBundle()->getLocaleNames()), $value); } /** * {@inheritdoc} */ public function loadChoicesForValues(array $values, $value = null) { // Optimize $values = array_filter($values); if (empty($values)) { return array(); } // If no callable is set, values are the same as choices if (null === $value) { return $values; } return $this->loadChoiceList($value)->getChoicesForValues($values); } /** * {@inheritdoc} */ public function loadValuesForChoices(array $choices, $value = null) { // Optimize $choices = array_filter($choices); if (empty($choices)) { return array(); } // If no callable is set, choices are the same as values if (null === $value) { return $choices; } return $this->loadChoiceList($value)->getValuesForChoices($choices); } } __halt_compiler();----SIGNATURE:----na6Od4bZTlwqOrh7PoTiSsBBH3GOddBUaOiDNK5f2YksqRI4ELoBV8gFoiWMy0LnEKMHog8bJIVXunbmFTEBUGfJ1Wa83PhJVlooJ6+/xiJofjkXY04J/1urWuNauUqq+eduwKbS7cYZREvCvJPco+gzCOvIEJzwFZfrdsrkHHNXgVd4xSHlg6T0S/oTv+EgH+R4Y0HPQJb75hwqsXSgCV97eyne6B/mgK6CIU84ET0powKJabVTbRcsMnGAR/6zuD4EStJ5awvlJ/gJ1CjEotoZ0Ms7YtKpyIgSV4is+u1gi40AubW3wEXrn2RpiQ6rp+FOe82AftOKopY9A8g3yiT1M8rPtqhmbZS2FtgF/YMGzTq8zT0YgQiU1WEt9oy4BIE8V0FvhMXTo0ec2LrG/SyX8SujzqzrFGHBp6nT8ubJERMGZEDPsPXPqy43h4dmss2dyF6RzFT9AYylZSHkCFJGAjNGAsFnSgmdBtjWZwvax6+Z3bObYy4EqSk3mxrYtnLHSP2Epvdb6sErtkUxRMMhMaYj1NSjTIm/ZAj54TqIgwGEHwlDKvUySCvi1I2bZTHb6amfNkvbszfknuc8hoeN1jOSneodu4ohrzqp6Ygm1yjdDgwD4l7q4yex7P/NwQsF9F0BFj6hqcnYOSHE+dFmPvu33XU1V2+FZ82Jus0=----ATTACHMENT:----MTY4NjQzMzM4MzgzNjk1NSA0NTU1NjM4NzI2NDMxMDI5IDUzNTI1Mjk0MDg0NjcwNzQ=