<commit_before><?php

namespace AppBundle\Controller;

use AppBundle\Service\CardsData;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class FactionController extends Controller
{
    /**
     * @param string                 $faction_code
     * @param EntityManagerInterface $entityManager
     * @return Response
     */
    public function factionAction(string $faction_code, EntityManagerInterface $entityManager)
    {
        $response = new Response();
        $response->setPublic();
        $response->setMaxAge($this->getParameter('short_cache'));

        if ($faction_code === 'mini-factions') {
            $factions = $entityManager->getRepository('AppBundle:Faction')->findBy(['isMini' => true], ['code' => 'ASC']);
            $faction_name = "Mini-factions";
        } else {
            $factions = $entityManager->getRepository('AppBundle:Faction')->findBy(['code' => $faction_code]);
            if (!count($factions)) {
                throw $this->createNotFoundException();
            }
            $faction_name = $factions[0]->getName();
        }


        $result = [];<commit_msg>Forgot to instance a service<commit_after><?php

namespace AppBundle\Controller;

use AppBundle\Service\CardsData;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class FactionController extends Controller
{
    /**
     * @param string                 $faction_code
     * @param EntityManagerInterface $entityManager
     * @return Response
     */
    public function factionAction(string $faction_code, EntityManagerInterface $entityManager, CardsData $cardsData)
    {
        $response = new Response();
        $response->setPublic();
        $response->setMaxAge($this->getParameter('short_cache'));

        if ($faction_code === 'mini-factions') {
            $factions = $entityManager->getRepository('AppBundle:Faction')->findBy(['isMini' => true], ['code' => 'ASC']);
            $faction_name = "Mini-factions";
        } else {
            $factions = $entityManager->getRepository('AppBundle:Faction')->findBy(['code' => $faction_code]);
            if (!count($factions)) {
                throw $this->createNotFoundException();
            }
            $faction_name = $factions[0]->getName();
        }


        $result = [];
{'fraction_non_alphanumeric': 0.1360488798370672, 'fraction_numerical': 0.000814663951120163, 'mean_word_length': 3.032840722495895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '3425862', 'n_tokens_mistral': 668, 'n_tokens_neox': 653, 'n_words': 116}