<commit_before><?php

namespace Cac\BarBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Cac\BarBundle\Entity\Bar;
use Cac\BarBundle\Entity\Comment;
use Cac\BarBundle\Entity\Promotion;
use Cac\BarBundle\Entity\PromoOffertes;
use Cac\BarBundle\Entity\PromoOffertesRepository;
use Cac\BarBundle\Entity\Image;
use Cac\BarBundle\Form\Type\BarType;
use Cac\BarBundle\Form\Type\PromotionType;
use Cac\BarBundle\Form\Type\BarEditType;
/**
 * Bar controller.
 *
 * @Route("/bars")
 */
class BarController extends Controller
{
    /**
     * @Route("/list", name="bars")
     * @Template()
     */
    public function indexAction()
    {
        setlocale(LC_TIME, "fr_FR");
        $today = strftime("%A");
        $em = $this->getDoctrine()->getManager();
        $entities = $em->getRepository('CacBarBundle:Bar')->findAll();
        $bars = array();
        $i = 0;
        foreach ($entities as $entity) {
            $promoOfTheDay = $entity->getPromotionByDay($today)->getOption('value')->getValue();
            $happyHourOfTheDay = $entity->getHappyHourByDay($today)->getOption('value')->getValue();
            $nbAvis = count($entity->getComments()->getValues());
            $coms = $entity->getComments()->getValues();
            $note = 0;
            foreach ($coms as $com) {
                $note += $com->getNote();
            }<commit_msg>Added ucfirst for correct day value in for getOption<commit_after><?php

namespace Cac\BarBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Cac\BarBundle\Entity\Bar;
use Cac\BarBundle\Entity\Comment;
use Cac\BarBundle\Entity\Promotion;
use Cac\BarBundle\Entity\PromoOffertes;
use Cac\BarBundle\Entity\PromoOffertesRepository;
use Cac\BarBundle\Entity\Image;
use Cac\BarBundle\Form\Type\BarType;
use Cac\BarBundle\Form\Type\PromotionType;
use Cac\BarBundle\Form\Type\BarEditType;
/**
 * Bar controller.
 *
 * @Route("/bars")
 */
class BarController extends Controller
{
    /**
     * @Route("/list", name="bars")
     * @Template()
     */
    public function indexAction()
    {
        setlocale(LC_TIME, "fr_FR");
        $today = ucfirst(strftime("%A"));
        $em = $this->getDoctrine()->getManager();
        $entities = $em->getRepository('CacBarBundle:Bar')->findAll();
        $bars = array();
        $i = 0;
        foreach ($entities as $entity) {
            $promoOfTheDay = $entity->getPromotionByDay($today)->getOption('value')->getValue();
            $happyHourOfTheDay = $entity->getHappyHourByDay($today)->getOption('value')->getValue();
            $nbAvis = count($entity->getComments()->getValues());
            $coms = $entity->getComments()->getValues();
            $note = 0;
            foreach ($coms as $com) {
                $note += $com->getNote();
            }
{'fraction_non_alphanumeric': 0.14517029592406477, 'fraction_numerical': 0.0011166945840312675, 'mean_word_length': 3.683660130718954, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '4369892', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1076, 'n_words': 172}