<commit_before><?php
/**
 * Created by JetBrains PhpStorm.
 * User: fernando
 * Date: 07/05/13
 * Time: 19:23
 * To change this template use File | Settings | File Templates.
 */

namespace Fer\ApiBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;

class BaseController extends FOSRestController {

    public function getAction($name)
    {
        $view = $this->view(array('nombre' => $name), 200);
        return $this->handleView($view);
    }

    public function postAction()
    {
        $value = $this->getRequest()->request->get('value','no hay parametro');
        $view = $this->view(array('enviado' => $value), 200);
        return $this->handleView($view);
    }
}<commit_msg>renombrado el api y añadida una nueva con objetos complejos<commit_after><?php
/**
 * Created by JetBrains PhpStorm.
 * User: fernando
 * Date: 07/05/13
 * Time: 19:23
 * To change this template use File | Settings | File Templates.
 */

namespace Fer\ApiBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;

class Model {
    public $nombre;
    public $apellido;
    public $fecha;
    public $miarray;
}

class BaseController extends FOSRestController {

    public function postAction()
    {
        $value = $this->getRequest()->request->get('value','no hay parametro');
        $view = $this->view(array('enviado' => $value), 200);
        return $this->handleView($view);
    }

    public function getComplejoAction()
    {
        $obj = new Model();
        $obj->nombre = 'Fer';
        $obj->apellido = 'Ape';
        $obj->fecha = new \DateTime();
        $data = array();
        array_push($data, $obj);
        $obj2 = clone $obj;
        $obj2->nombre = 'Alb';
        $obj2->miarray = array('a', 'b');
        array_push($data,$obj2);
        $view = $this->view($data, 200);
        return $this->handleView($view);
    }

    public function getNombreAction($name)
    {
        $view = $this->view(array('nombre' => $name), 200);
        return $this->handleView($view);
    }
}
{'fraction_non_alphanumeric': 0.15521502718734553, 'fraction_numerical': 0.019278299555116164, 'mean_word_length': 2.8923076923076922, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '3130602', 'n_tokens_mistral': 681, 'n_tokens_neox': 643, 'n_words': 150}