<commit_before><?php

namespace App\Admin;

use App\Entity\Tag;
use App\Form\DataTransformer\TagTransformer;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Form\Type\ModelListType;
use Sonata\Form\Type\BooleanType;
use Sonata\Form\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class PostAdmin extends AbstractAdmin
{
    protected $baseRouteName = 'App\Entity\Post';
    protected $baseRoutePattern = 'Post';
    protected $datagridValues = [
        '_sort_order' => 'DESC',
        '_sort_by' => 'createdAt',
    ];

    private $default_locale;

    private $locales;

    public function setParameters($default_locale, $locales)
    {
        $this->default_locale = $default_locale;
        $this->locales = $locales;
    }

    /**
     * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
     *
     * @return void
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('title')
            ->add('shortDescription')
            ->add('text', CKEditorType::class,
                [
                    'attr' => [
                            'class' => 'wysihtml5',
                            'style' => 'height:300px',
                    ],
                ]
            )
            ->add('mainPicture', ModelListType::class,
                [
                    'required' => false,
                    'btn_list' => false,
                ], [
                    'link_parameters' => [
                        'context' => 'post',
                        'provider' => 'sonata.media.provider.image',
                    ],
                ]
            )
            ->add(
                $formMapper->create('tags', TextType::class, [<commit_msg>Enable list images to news<commit_after><?php

namespace App\Admin;

use App\Entity\Tag;
use App\Form\DataTransformer\TagTransformer;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Form\Type\ModelListType;
use Sonata\Form\Type\BooleanType;
use Sonata\Form\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class PostAdmin extends AbstractAdmin
{
    protected $baseRouteName = 'App\Entity\Post';
    protected $baseRoutePattern = 'Post';
    protected $datagridValues = [
        '_sort_order' => 'DESC',
        '_sort_by' => 'createdAt',
    ];

    private $default_locale;

    private $locales;

    public function setParameters($default_locale, $locales)
    {
        $this->default_locale = $default_locale;
        $this->locales = $locales;
    }

    /**
     * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
     *
     * @return void
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('title')
            ->add('shortDescription')
            ->add('text', CKEditorType::class,
                [
                    'attr' => [
                            'class' => 'wysihtml5',
                            'style' => 'height:300px',
                    ],
                ]
            )
            ->add('mainPicture', ModelListType::class,
                [
                    'required' => false,
                ], [
                    'link_parameters' => [
                        'context' => 'post',
                        'provider' => 'sonata.media.provider.image',
                    ],
                ]
            )
            ->add(
                $formMapper->create('tags', TextType::class, [
{'fraction_non_alphanumeric': 0.12102385685884692, 'fraction_numerical': 0.0019880715705765406, 'mean_word_length': 1.8791130185979972, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, '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': '6055274', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1111, 'n_words': 178}