<commit_before><?php

namespace Graviton\CoreBundle\Controller;

use Graviton\RestBundle\Controller\RestController;

/**
 * This is just a dummy controller for demonstrating
 * the extension of generated bundles..
 *
 * @category GravitonCoreBundle
 * @package  Graviton
 * @author   <NAME> <<EMAIL>>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://swisscom.com
 */
class ShowcaseExtensionController extends RestController
{

    /**
     * IMPORTANT NOTES IF YOU INHERIT FROM DYNAMICALLY GENERATED BUNDLE!
     *
     * Remember that if you want to change data and/or add fields; that those
     * fields must be present:
     * 1) in the originating Document
     * 2) in the serializer configuration
     * 3) maybe include validation rules in validation.xml
     *
     * it's not the right way to let something generate it and then completely change it's
     * structure. if you need something that you cannot generate so that you have to modify
     * *everything* when inheriting - don't generate it in the first place! ;-)
     *
     * the basic workflow is to define the entire structure in the json file, then here
     * (overriding) you *only* modify and alter data - don't add new properties.
     *
     * @return \Symfony\Component\HttpFoundation\Response $response Response with result or error
     */
    public function allAction()
    {
        // to just get parent reponse
        // $response = parent::allAction();

        $data = $this->getModel()->findAll($this->getRequest());

        // here you could work with the objects..
        // or do own stuff
        return $this->getResponse(
            $data
        );
    }
}<commit_msg>fix showcase example (extending a generated service...)<commit_after><?php

namespace Graviton\CoreBundle\Controller;

use Graviton\RestBundle\Controller\RestController;

/**
 * This is just a dummy controller for demonstrating
 * the extension of generated bundles..
 *
 * @category GravitonCoreBundle
 * @package  Graviton
 * @author   <NAME> <<EMAIL>>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://swisscom.com
 */
class ShowcaseExtensionController extends RestController
{

    /**
     * IMPORTANT NOTES IF YOU INHERIT FROM DYNAMICALLY GENERATED BUNDLE!
     *
     * Remember that if you want to change data and/or add fields; that those
     * fields must be present:
     * 1) in the originating Document
     * 2) in the serializer configuration
     * 3) maybe include validation rules in validation.xml
     *
     * it's not the right way to let something generate it and then completely change it's
     * structure. if you need something that you cannot generate so that you have to modify
     * *everything* when inheriting - don't generate it in the first place! ;-)
     *
     * the basic workflow is to define the entire structure in the json file, then here
     * (overriding) you *only* modify and alter data - don't add new properties.
     *
     * @return \Symfony\Component\HttpFoundation\Response $response Response with result or error
     */
    public function allAction()
    {
        // to just get parent reponse
        // $response = parent::allAction();

        $data = $this->getModel()->findAll($this->getRequest());

        $response = $this->getResponse()
            ->setStatusCode(Response::HTTP_OK)
            ->setContent($this->serialize($data));
        // here you could work with the objects..
        // or do own stuff
        return $response;
    }
}
{'fraction_non_alphanumeric': 0.09103602345713488, 'fraction_numerical': 0.0016755096341803965, 'mean_word_length': 2.794491525423729, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '258140', 'n_tokens_mistral': 978, 'n_tokens_neox': 928, 'n_words': 369}