* * 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 CurrencyType extends AbstractType implements ChoiceLoaderInterface { /** * Currency loaded choice list. * * The choices are lazy loaded and generated from the Intl component. * * {@link \Symfony\Component\Intl\Intl::getCurrencyBundle()}. * * @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 'currency'; } /** * {@inheritdoc} */ public function loadChoiceList($value = null) { if (null !== $this->choiceList) { return $this->choiceList; } return $this->choiceList = new ArrayChoiceList(array_flip(Intl::getCurrencyBundle()->getCurrencyNames()), $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:----MDFs+zyGQsPhwOCHUtXm30Apmm4gsWwHwW2NLFxJVT22ooEtPFaMxb/sqEzihVSdY4k3WTm2sXnU2k1kcQLaSfZ8LEE1yy5mHUIUJLRVBJZncNCggNdoAUXx5VSFc6ap5OXSFD9abKOlrCal57IdUDtqFWFBRkRIVMu5lJv1Fg6xheNj6nRsnPVTPbHmPCs+Sv1zq/iaQMFtEETDI2wI0JgwR3vtH1ahcK5/X1HzPPyA5JFNKrX7oqdwrhetGdZ2iyz+hucpmwkikvBoQfXqIIIFgef/gPDEkzzJlBzrha8BnFh0W8V2R0OZgCT3pjv2xUShDARA7REzS6rS/rcqd6/wESdQCVhOFiSCJ5PwWYUBMtvMChhhbbejc/Olot31cT2+sLOjFXTlz+iaWlS9gOiWxHv2+tdkuXXH2gfwxrgpH5QsVwdJIHkEyBKI6nJagH6rONpoKeLo2c9/EQ1QnwjZrZQ3e3dzveibKsMsp9y+cAzU1e5T/32sjZo9o732rIQ4RsNZ5PbOTSEP4bcfdUNFJXantUJCfyv2coLL5Th1jW0GJO/JH5Zv69fLyNrSicYaDCa1pC1bItuXzujkrFAI0r3mbrY+jy0qNVk3G34iOP+2LiChXNpEWHyQmyut+HcYdN/wtpqVVlhJ3Z+ooRoWRQeJ8pJcsH2m8DdH94s=----ATTACHMENT:----ODQ3NDA3NTUwNzU0MzY1MiA5OTIyNzIwNDkzODY3MjQ2IDE1MzcxNzg1Nzg1NzM0OA==