* * 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:----M6YuhQNf2L7/jFANZjmKWWVtTacyaRlnYgQHl0I0D+owGWGjri1KpIlJKJ46KYlbJSJrwMwHKnvJcmIJgVbqwblq+hCwU9GE9Yf2DCILPiAA1ShV513b1Ckh0MUC7Zl78TnhbwMX9Td3qpKmgLgiD3byBTxTSSuPwOiUlCcKetYHrAuKd9+AdPG3NmyDDtgp9M/Utj5bK7cy118y0U+KzasdmGGjH6E1MgmQVteQ+Mc7I3p85AJec1T0MmpW7OTdRYXraPFnAVbS/f6bfDXvb/qB2Mv/UxcmuVusyEht/UKKDQ0mbGMhugbKLANzl7hrZb55ZDfiPgT16bBhUJjccfOStMGrbsG6TfnMjFCv3Kio/pJ4R305FD6NOFwp07GyXKM5mMXA50LlNs1j0IsXqhtMzxg1kvKsWq8jkU6Y0kqUGWEDNYzmhMh0HQA0ybUMP1veW+Rla66YAjCt6FWogfmrMIvyjsQWxq6/U+VMoZ81V0cPndvYiky1VsuThU17y4qJFFwflb5v4HsgRGSSZ8Tl3MFM30m1QwCtKRvKf7IsLfXWH6iqBY05esbuGIDZv5GRLqCYm5XD6lSxAyxUi9sE6ThOZwKAXleL41PjhGhxjnZ+tTTU1k+IEhsJg0nXxw3FqSHc7JCIyubnUBKM2rM6vJL44i2Y+cSg7nxlvlc=----ATTACHMENT:----Njg2NTc2MzAxNzAyMTMyIDc2MDY0NTY1OTg3NDA0NiA2MTAzMzU2MDQ5Mjc3NjQ4