<commit_before><?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class FilmController extends Controller
{
    /**
     * @Route("/film/{id}", name="filmDetails")
     */
    public function filmDetailsAction($id)
    {
        $filmRepo = $this->getDoctrine()->getRepository("AppBundle:Film");
        $film = $filmRepo->findOneById($id);
        
        // CHECKER SI ON A BIEN RECUPERE UN FILM, ELSE THROW 404
        
        $params = array(
            "film" => $film
        );
        
        return $this->render('default/filmdetails.html.twig', $params);
    }
}
<commit_msg>add function to load more films via ajax<commit_after><?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class FilmController extends Controller
{
    /**
     * @Route("/film/{id}", name="filmDetails")
     */
    public function filmDetailsAction($id)
    {
        $filmRepo = $this->getDoctrine()->getRepository("AppBundle:Film");
        $film = $filmRepo->findOneById($id);
        
        // CHECKER SI ON A BIEN RECUPERE UN FILM, ELSE THROW 404
        
        $params = array(
            "film" => $film
        );
        
        return $this->render('includes/filmdetails.html.twig', $params);
    }
    
    /**
     * @Route("/loadMoarFilms/{offset}", name="loadMoarFilms")
     */
    public function loadMoarFilms($offset)
    {
        $numPerPage = 4;
                
        $filmRepo = $this->getDoctrine()->getRepository("AppBundle:Film");
        $lastFilms = $filmRepo->paginate($offset);
        
        $params = array(
            "lastFilms" => $lastFilms
        );
        
        return $this->render('includes/moarfilms.html.twig', $params);
    }
}

{'fraction_non_alphanumeric': 0.13494461228600202, 'fraction_numerical': 0.003524672708962739, 'mean_word_length': 2.5293072824156306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '4881886', 'n_tokens_mistral': 599, 'n_tokens_neox': 576, 'n_words': 105}