<commit_before><?php

namespace Form\Listener;

use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Form\Shared\UrlResolver;

/**
 * Follows a submitted URL to find the actual protocol and final address
 *
 */
class GetResolvedUrlListener implements EventSubscriberInterface
{

    public function onSubmit(FormEvent $event)
    {
        $data = $event->getData();
        
        if ($data === '') {
            return;
        }

        if ($data === null) {
            return;
        }

        $resolver = new UrlResolver();
        try {
            $redirectURL = $resolver->resolve($data);
            $event->setData($redirectURL);
        } catch (\Exception $e) {
            // We can do nothing with this now, this will be caught by the constraint
        }
    }

    public static function getSubscribedEvents()
    {
        return array(FormEvents::SUBMIT => 'onSubmit');
    }
}
<commit_msg>Move from old to new array notation in one file<commit_after><?php

namespace Form\Listener;

use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Form\Shared\UrlResolver;

/**
 * Follows a submitted URL to find the actual protocol and final address
 *
 */
class GetResolvedUrlListener implements EventSubscriberInterface
{

    public function onSubmit(FormEvent $event)
    {
        $data = $event->getData();
        
        if ($data === '') {
            return;
        }

        if ($data === null) {
            return;
        }

        $resolver = new UrlResolver();
        try {
            $redirectURL = $resolver->resolve($data);
            $event->setData($redirectURL);
        } catch (\Exception $e) {
            // We can do nothing with this now, this will be caught by the constraint
        }
    }

    public static function getSubscribedEvents()
    {
        return [FormEvents::SUBMIT => 'onSubmit'];
    }
}

{'fraction_non_alphanumeric': 0.10681038706516413, 'fraction_numerical': 0.0, 'mean_word_length': 2.3475409836065575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '818363', 'n_tokens_mistral': 555, 'n_tokens_neox': 548, 'n_words': 151}