<commit_before><?php
/*
 * This file licensed under the MIT license.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Swop\Bundle\ConfigStoreBundle\Controller;

use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Routing\ClassResourceInterface;
use FOS\RestBundle\Controller\Annotations as Rest;
use Swop\ConfigStore\Exception\UnknownGroupException;
use Swop\ConfigStore\Model\AppGroup;

class GroupController extends FOSRestController implements ClassResourceInterface
{
    /**
     * Gets a group
     *
     * @param int $groupId Id of the group
     *
     * @return AppGroup
     *
     * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
     *
     * @Rest\View(serializerGroups="AppGroup")
     *
     */
    public function getAction($groupId)
    {
        $appManager = $this->get('swop.config_store.manager.app');

        try {
            $group = $appManager->getGroup($groupId);
        } catch (UnknownGroupException $e) {
            throw $this->createNotFoundException($e->getMessage());
        }

        return $group;
    }

    /**
     * Gets all groups
     *
     * @return AppGroup
     */
    public function cgetAction()
    {
        $appManager = $this->get('swop.config_store.manager.app');

        $groups = $appManager->allGroups();

        return $groups;
    }
}<commit_msg>Adds missing Serialization group in AppGroup collection listing controller action<commit_after><?php
/*
 * This file licensed under the MIT license.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Swop\Bundle\ConfigStoreBundle\Controller;

use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Routing\ClassResourceInterface;
use FOS\RestBundle\Controller\Annotations as Rest;
use Swop\ConfigStore\Exception\UnknownGroupException;
use Swop\ConfigStore\Model\AppGroup;

class GroupController extends FOSRestController implements ClassResourceInterface
{
    /**
     * Gets a group
     *
     * @param int $groupId Id of the group
     *
     * @return AppGroup
     *
     * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
     *
     * @Rest\View(serializerGroups="AppGroup")
     *
     */
    public function getAction($groupId)
    {
        $appManager = $this->get('swop.config_store.manager.app');

        try {
            $group = $appManager->getGroup($groupId);
        } catch (UnknownGroupException $e) {
            throw $this->createNotFoundException($e->getMessage());
        }

        return $group;
    }

    /**
     * Gets all groups
     *
     * @Rest\View(serializerGroups="AppGroup")
     *
     * @return AppGroup
     */
    public function cgetAction()
    {
        $appManager = $this->get('swop.config_store.manager.app');

        $groups = $appManager->allGroups();

        return $groups;
    }
}
{'fraction_non_alphanumeric': 0.11107491856677525, 'fraction_numerical': 0.0, 'mean_word_length': 2.858040201005025, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '6439559', 'n_tokens_mistral': 875, 'n_tokens_neox': 863, 'n_words': 198}