<commit_before><?php

namespace CubicMushroom\Symfony\StripeBundle\Form\Type;

use Symfony\Component\Form\AbstractType;

/**
 * Class StripeInputType
 *
 * @package CubicMushroom\Symfony\StripeBundle
 *
 * @see     \spec\CubicMushroom\Symfony\StripeBundle\Form\Type\StripeInputTypeSpec
 */
class StripeInputType extends AbstractType
{
    /**
     * @return string
     */
    public function getName()
    {
        return 'cm_stripe_input';
    }


    /**
     * @return string
     */
    public function getParent()
    {
        return 'text';
    }


}<commit_msg>Added code to throw an exception if data is submitted for these forms<commit_after><?php

namespace CubicMushroom\Symfony\StripeBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * Class StripeInputType
 *
 * @package CubicMushroom\Symfony\StripeBundle
 *
 * @see     \spec\CubicMushroom\Symfony\StripeBundle\Form\Type\StripeInputTypeSpec
 */
class StripeInputType extends AbstractType
{
    /**
     * @return string
     */
    public function getName()
    {
        return 'cm_stripe_input';
    }


    /**
     * @return string
     */
    public function getParent()
    {
        return 'text';
    }


    /**
     * Just ensures that no data is submitted with this form field, as it should be protected
     *
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->addViewTransformer(
            new CallbackTransformer(
                function ($originalDescription) {
                    return $originalDescription;
                },
                function ($submittedDescription) {
                    if (!is_null($submittedDescription)) {
                        throw new \RuntimeException(
                            'Sensitive data has been submitted via you\'re form!!!  This should not happen unless '.
                            "your server is PCI compliant.\n".
                            'The '.__CLASS__.'::finishView() method should prevent the name attribute being added to '.
                            'the field.'
                        );
                    }
                }
            )
        );
    }


}
{'fraction_non_alphanumeric': 0.09201680672268908, 'fraction_numerical': 0.0, 'mean_word_length': 1.9072039072039073, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3377752', 'n_tokens_mistral': 660, 'n_tokens_neox': 637, 'n_words': 147}