<commit_before><?php

namespace Ruudk\Payment\MollieBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Omnipay\Common\Issuer;

class IdealType extends AbstractType
{
    /**
     * @var Issuer[]
     */
    protected $issuers = array();

    /**
     * @param string $name
     * @param array  $issuers
     */
    public function __construct(array $issuers)
    {
        foreach ($issuers as $issuerId => $issuerName) {
            $this->issuers[] = new Issuer($issuerId, $issuerName, 'ideal');
        }
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $banks = array();
        $defaultBank = null;
        foreach($this->issuers AS $issuer) {
            if('ideal' !== $issuer->getPaymentMethod()) {
                continue;
            }

            $banks[$issuer->getId()] = $issuer->getName();
            $defaultBank = $issuer->getId();
        }

        if(1 !== count($banks)) {
            $defaultBank = null;
        }

        if (!empty($options['bank'])) {
            $defaultBank = $options['bank'];
        }

        $builder->add('bank', 'choice', array(
            'label'       => 'ruudk_payment_mollie.ideal.bank.label',
            'data'        => $defaultBank,
            'empty_value' => 'ruudk_payment_mollie.ideal.bank.empty_value',
            'choices'     => $banks
        ));
    }

    /**
     * Configures the options for this type.
     *
     * @param OptionsResolver $resolver The resolver for the options.
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'bank' => ''
        ));

        $resolver->setAllowedTypes('bank', 'string');
    }
}
<commit_msg>Changed form type to FQCN for IdealType fields<commit_after><?php

namespace Ruudk\Payment\MollieBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Omnipay\Common\Issuer;

class IdealType extends AbstractType
{
    /**
     * @var Issuer[]
     */
    protected $issuers = array();

    /**
     * @param string $name
     * @param array  $issuers
     */
    public function __construct(array $issuers)
    {
        foreach ($issuers as $issuerId => $issuerName) {
            $this->issuers[] = new Issuer($issuerId, $issuerName, 'ideal');
        }
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $banks = array();
        $defaultBank = null;
        foreach($this->issuers AS $issuer) {
            if('ideal' !== $issuer->getPaymentMethod()) {
                continue;
            }

            $banks[$issuer->getId()] = $issuer->getName();
            $defaultBank = $issuer->getId();
        }

        if(1 !== count($banks)) {
            $defaultBank = null;
        }

        if (!empty($options['bank'])) {
            $defaultBank = $options['bank'];
        }

        $builder->add('bank', ChoiceType::class, array(
            'label'       => 'ruudk_payment_mollie.ideal.bank.label',
            'data'        => $defaultBank,
            'empty_value' => 'ruudk_payment_mollie.ideal.bank.empty_value',
            'choices'     => $banks
        ));
    }

    /**
     * Configures the options for this type.
     *
     * @param OptionsResolver $resolver The resolver for the options.
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'bank' => ''
        ));

        $resolver->setAllowedTypes('bank', 'string');
    }
}

{'fraction_non_alphanumeric': 0.1393939393939394, 'fraction_numerical': 0.0005270092226613965, 'mean_word_length': 2.158069883527454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3182298', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1125, 'n_words': 211}