<commit_before><?php

namespace Domora\TvGuide\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use DDesrosiers\SilexAnnotations\Annotations as Silex;

use Domora\TvGuide\Data\Service;

class ServiceController extends AbstractController
{
    const SERVICE_ENTITY = 'Domora\TvGuide\Data\Service';
    
    /**
     * @Silex\Route(
     *     @Silex\Request(method="GET", uri="services")
     * )
     */
    public function getServicesAction(Request $request)
    {
        $country = $request->get('country');
        $qb = $this->em->createQueryBuilder();
        
        $query = $qb->select('s')
            ->from(self::SERVICE_ENTITY, 's');
            
        if ($country) {
            $query->where('s.country = :country')
                ->setParameter('country', $country);
        }
            
        $services = $query->getQuery()->getResult();
            
        return $this->serializer->serialize($services, ['list']);
    }
    
    /**
     * @Silex\Route(
     *     @Silex\Request(method="GET", uri="services/{service}"),
     *     @Silex\Convert(variable="service", callback="entity.provider:convertService")
     * )
     */
    public function getServiceAction(Service $service)
    {
        return $this->serializer->serialize($service, ['list']);
    }
}<commit_msg>Fix wrong serialization group<commit_after><?php

namespace Domora\TvGuide\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use DDesrosiers\SilexAnnotations\Annotations as Silex;

use Domora\TvGuide\Data\Service;

class ServiceController extends AbstractController
{
    const SERVICE_ENTITY = 'Domora\TvGuide\Data\Service';
    
    /**
     * @Silex\Route(
     *     @Silex\Request(method="GET", uri="services")
     * )
     */
    public function getServicesAction(Request $request)
    {
        $country = $request->get('country');
        $qb = $this->em->createQueryBuilder();
        
        $query = $qb->select('s')
            ->from(self::SERVICE_ENTITY, 's');
            
        if ($country) {
            $query->where('s.country = :country')
                ->setParameter('country', $country);
        }
            
        $services = $query->getQuery()->getResult();
            
        return $this->serializer->serialize($services, ['list']);
    }
    
    /**
     * @Silex\Route(
     *     @Silex\Request(method="GET", uri="services/{service}"),
     *     @Silex\Convert(variable="service", callback="entity.provider:convertService")
     * )
     */
    public function getServiceAction(Service $service)
    {
        return $this->serializer->serialize($service, ['service']);
    }
}
{'fraction_non_alphanumeric': 0.15283363802559416, 'fraction_numerical': 0.0, 'mean_word_length': 2.5440414507772022, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '2362948', 'n_tokens_mistral': 817, 'n_tokens_neox': 811, 'n_words': 119}