<commit_before><?php

namespace App\Controller\Framework;

use App\Entity\Framework\AdditionalField;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\RouterInterface;
use App\Repository\Framework\AdditionalFieldRepository;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use App\Form\Type\AdditionalFieldType;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;

/**
 * AdditionalField controller.
 *
 * @Route("/additionalfields")
 * @IsGranted("ROLE_SUPER_USER")
 */
class AdditionalFieldController extends AbstractController
{
    /**
     * @var \Twig_Environment
     */
    private $twig;

    /**
     * @var additionalFieldRepository
     */
    private $additionalFieldRepository;

    /**
     * @var formFactory
     */
    private $formFactory;

    /**
     * @var entityManager
     */
    private $entityManager;

    /**
     * @var router
     */
    private $router;

    public function __construct(\Twig_Environment $twig, AdditionalFieldRepository $additionalFieldRepository, FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, RouterInterface $router)
    {
        $this->twig = $twig;
        $this->additionalFieldRepository = $additionalFieldRepository;
        $this->formFactory = $formFactory;
        $this->entityManager = $entityManager;
        $this->router = $router;
    }

    /**
     * List all AdditionalField entities.
     *
     * @Route("/", name="additionalfield_index")
     */
    public function index()
    {
      $html = $this->twig->render('framework/additional_field/index.html.twig', [
        'additional_fields' => $this->additionalFieldRepository->findAll()
      ]);
      return new Response($html);
    }

    /**<commit_msg>Update the isgranted role for the additonal fields controller.<commit_after><?php

namespace App\Controller\Framework;

use App\Entity\Framework\AdditionalField;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\RouterInterface;
use App\Repository\Framework\AdditionalFieldRepository;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use App\Form\Type\AdditionalFieldType;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;

/**
 * AdditionalField controller.
 *
 * @Route("/additionalfields")
 */
class AdditionalFieldController extends AbstractController
{
    /**
     * @var \Twig_Environment
     */
    private $twig;

    /**
     * @var additionalFieldRepository
     */
    private $additionalFieldRepository;

    /**
     * @var formFactory
     */
    private $formFactory;

    /**
     * @var entityManager
     */
    private $entityManager;

    /**
     * @var router
     */
    private $router;

    public function __construct(\Twig_Environment $twig, AdditionalFieldRepository $additionalFieldRepository, FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, RouterInterface $router)
    {
        $this->twig = $twig;
        $this->additionalFieldRepository = $additionalFieldRepository;
        $this->formFactory = $formFactory;
        $this->entityManager = $entityManager;
        $this->router = $router;
    }

    /**
     * List all AdditionalField entities.
     *
     * @Route("/", name="additionalfield_index")
     * @IsGranted("ROLE_SUPER_USER")
     */
    public function index()
    {
      $html = $this->twig->render('framework/additional_field/index.html.twig', [
        'additional_fields' => $this->additionalFieldRepository->findAll()
      ]);
      return new Response($html);
    }

    /**
{'fraction_non_alphanumeric': 0.11351883772469835, 'fraction_numerical': 0.0, 'mean_word_length': 3.6475972540045767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '5321332', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1093, 'n_words': 194}