<commit_before><?php

namespace Tom;

use Silex\Application;
use Symfony\Component\HttpFoundation\Request;

use Symfony\Component\HttpFoundation\JsonResponse;

class ApiController
{
    /**
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function initAction(Request $request, Application $app)
    {
        return new JsonResponse(array(1, 1, $request->get('id')));
    }
}<commit_msg>changed example controller to use twig<commit_after><?php

namespace Tom;

use Silex\Application;
use Symfony\Component\HttpFoundation\Request;

use Symfony\Component\HttpFoundation\JsonResponse;

class ApiController
{
    /**
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function initAction(Request $request, Application $app)
    {
        $data = array ("success" => true);
        return $app['twig']->render('api.json', array('data' => $data));
    }
}
{'fraction_non_alphanumeric': 0.12723214285714285, 'fraction_numerical': 0.002232142857142857, 'mean_word_length': 4.067796610169491, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5738305', 'n_tokens_mistral': 267, 'n_tokens_neox': 272, 'n_words': 54}