<commit_before><?php

namespace Guard\Api\v1Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
    public function indexAction($name)
    {
        return $this->render('GuardApiv1Bundle:Default:index.html.twig', array('name' => $name));
    }
}<commit_msg>controllerApi v0<commit_after><?php

namespace Guard\Api\v1Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;

class DefaultController extends Controller {

    public function indexAction() {
        if ($this->getRequest() == 'POST') {
            if (isJson($this->getRequest())){
                $id = $this->getRequest()->id;
                $state = $this->getRequest()->state;
                $date = $this->getRequest()->date;
                
                $validator = $this->get('validator');
                $errorList = $validator->validate($author);
                
                $this->get('logger')->info(id .','.state.','.date.'\n');
            }
        }
        
        return new Response("ok");
    }

    private function isJson($string) {
        json_decode($string);
        return (json_last_error() == JSON_ERROR_NONE);
    }

}
{'fraction_non_alphanumeric': 0.14088598402323893, 'fraction_numerical': 0.002904865649963689, 'mean_word_length': 2.6551724137931036, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2010342', 'n_tokens_mistral': 376, 'n_tokens_neox': 371, 'n_words': 64}