<commit_before><?php

/*
 * This file is part of the Integrated package.
 *
 * (c) e-Active B.V. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Integrated\Bundle\BlockBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList;

use Integrated\Bundle\BlockBundle\Locator\LayoutLocator;

/**
 * @author <NAME> <<EMAIL>>
 */
class LayoutChoiceType extends AbstractType
{
    /**
     * @var LayoutLocator
     */
    protected $locator;

    /**
     * @param LayoutLocator $locator
     */
    public function __construct(LayoutLocator $locator)
    {
        $this->locator = $locator;
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'choices' => function (Options $options) {
                return $this->getChoiceList($options['type']);
            },
        ]);

        $resolver->setRequired([
            'type',
        ]);
    }

    /**
     * @param $type
     * @return array
     */
    protected function getChoiceList($type)
    {
        $layout = $this->locator->getLayouts($type);
        return $layout;
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {<commit_msg>Fixed the layout form type<commit_after><?php

/*
 * This file is part of the Integrated package.
 *
 * (c) e-Active B.V. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Integrated\Bundle\BlockBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList;

use Integrated\Bundle\BlockBundle\Locator\LayoutLocator;

/**
 * @author <NAME> <<EMAIL>>
 */
class LayoutChoiceType extends AbstractType
{
    /**
     * @var LayoutLocator
     */
    protected $locator;

    /**
     * @param LayoutLocator $locator
     */
    public function __construct(LayoutLocator $locator)
    {
        $this->locator = $locator;
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'choices_as_values' => true,
            'choice_label' => function ($value) {
                return $value;
            },
            'choices' => function (Options $options) {
                return $this->getChoiceList($options['type']);
            },
        ]);

        $resolver->setRequired([
            'type',
        ]);
    }

    /**
     * @param $type
     * @return array
     */
    protected function getChoiceList($type)
    {
        $layout = $this->locator->getLayouts($type);
        return $layout;
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
{'fraction_non_alphanumeric': 0.12566528681253697, 'fraction_numerical': 0.0, 'mean_word_length': 2.5239583333333333, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 29, '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': '2620852', 'n_tokens_mistral': 983, 'n_tokens_neox': 963, 'n_words': 205}