<commit_before><?php

namespace Oro\Bundle\EmailBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Validator\Constraints\NotNull;

use Oro\Bundle\FormBundle\Utils\FormUtils;

class SmtpType extends AbstractType
{
    protected $requiredFields = [
        'host',
        'port',
        'encryption',
        'username'
    ];

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'oro_email_smtp';
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            'enabled',
            'checkbox',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.enabled.label',
                'required' => false,
            ]
        );
        $builder->add(
            'host',
            'text',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.host.label',
                'required' => false,
            ]
        );
        $builder->add(
            'port',
            'integer',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.port.label',
                'required' => false,
            ]
        );
        $builder->add(
            'encryption',
            'choice',
            [
                'label'       => 'oro.email.mailbox.smtp_settings.encryption.label',
                'choices'     => ['ssl' => 'SSL', 'tls' => 'TLS'],
                'empty_data'  => null,
                'empty_value' => '',
                'required'    => false
            ]
        );
        $builder->add(
            'username',
            'text',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.username.label',
                'required' => false,
            ]
        );
        $builder->add(
            'password',
            'password',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.password.label',
                'required' => false,
            ]
        );
        $builder->addEventListener(
            FormEvents::PRE_SUBMIT,
            function(FormEvent $event) {<commit_msg>CRM-3796: Add email as activity for generated entities  - CS Fix<commit_after><?php

namespace Oro\Bundle\EmailBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Validator\Constraints\NotNull;

use Oro\Bundle\FormBundle\Utils\FormUtils;

class SmtpType extends AbstractType
{
    /** @var string[] */
    protected $requiredFields = [
        'host',
        'port',
        'encryption',
        'username'
    ];

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'oro_email_smtp';
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            'enabled',
            'checkbox',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.enabled.label',
                'required' => false,
            ]
        );
        $builder->add(
            'host',
            'text',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.host.label',
                'required' => false,
            ]
        );
        $builder->add(
            'port',
            'integer',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.port.label',
                'required' => false,
            ]
        );
        $builder->add(
            'encryption',
            'choice',
            [
                'label'       => 'oro.email.mailbox.smtp_settings.encryption.label',
                'choices'     => ['ssl' => 'SSL', 'tls' => 'TLS'],
                'empty_data'  => null,
                'empty_value' => '',
                'required'    => false
            ]
        );
        $builder->add(
            'username',
            'text',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.username.label',
                'required' => false,
            ]
        );
        $builder->add(
            'password',
            'password',
            [
                'label'    => 'oro.email.mailbox.smtp_settings.password.label',
                'required' => false,
            ]
        );
        $builder->addEventListener(
            FormEvents::PRE_SUBMIT,
            function (FormEvent $event) {
{'fraction_non_alphanumeric': 0.13422109490593956, 'fraction_numerical': 0.0008454872120059184, 'mean_word_length': 1.3530581800099453, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, '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': '3625343', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1298, 'n_words': 196}