<commit_before><?php

namespace Etu\Module\BugsBundle\Notification\Helper;

use Etu\Core\CoreBundle\Entity\Notification;
use Etu\Core\CoreBundle\Notification\Helper\HelperInterface;

/**
 * Notification for a new issue in opened issues.
 */
class NewOpenedHelper implements HelperInterface
{
    /**
     * @var \Twig_Environment
     */
    protected $twig;

    public function __construct(\Twig_Environment $twig)
    {
        $this->twig = $twig;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'bugs_new_opened';
    }

    /**
     * @return string
     */
    public function render(Notification $notification)
    {
        return $this->twig->render('EtuModuleBugsBundle:Notification:newOpened.html.twig', [
            'notif' => $notification,
        ]);
    }

    /**
     * @return string
     */
    public function renderMobile(Notification $notification)
    {
        if (1 == $notification->countEntities()) {
            return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().'.', 'message' => $notification->getTitle()];
        } elseif (2 == $notification->countEntities()) {
            return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().' et '.$notification->getEntities()[1]->getUser()->getFullName().'.', 'message' => $notification->getTitle()];
        } elseif (3 == $notification->countEntities()) {
            return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().', '.$notification->getEntities()[1]->getUser()->getFullName().' et 1 autre personne', 'message' => $notification->getTitle()];
        }

        return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().', '.$notification->getEntities()[1]->getUser()->getFullName().' et '.($notification->countEntities() - 2).' autres personnes', 'message' => $notification->getTitle()];
    }
}<commit_msg>fix notifications for opened bug<commit_after><?php

namespace Etu\Module\BugsBundle\Notification\Helper;

use Etu\Core\CoreBundle\Entity\Notification;
use Etu\Core\CoreBundle\Notification\Helper\HelperInterface;

/**
 * Notification for a new issue in opened issues.
 */
class NewOpenedHelper implements HelperInterface
{
    /**
     * @var \Twig_Environment
     */
    protected $twig;

    public function __construct(\Twig_Environment $twig)
    {
        $this->twig = $twig;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'bugs_new_opened';
    }

    /**
     * @return string
     */
    public function render(Notification $notification)
    {
        return $this->twig->render('EtuModuleBugsBundle:Notification:newOpened.html.twig', [
            'notif' => $notification,
        ]);
    }

    /**
     * @return string
     */
    public function renderMobile(Notification $notification)
    {
        if (1 == $notification->countEntities()) {
            return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().'.', 'message' => $notification->getFirstEntity()->getTitle()];
        } elseif (2 == $notification->countEntities()) {
            return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().' et '.$notification->getEntities()[1]->getUser()->getFullName().'.', 'message' => $notification->getFirstEntity()->getTitle()];
        } elseif (3 == $notification->countEntities()) {
            return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().', '.$notification->getEntities()[1]->getUser()->getFullName().' et 1 autre personne', 'message' => $notification->getFirstEntity()->getTitle()];
        }

        return ['title' => 'Nouveau bug de '.$notification->getFirstEntity()->getUser()->getFullName().', '.$notification->getEntities()[1]->getUser()->getFullName().' et '.($notification->countEntities() - 2).' autres personnes', 'message' => $notification->getFirstEntity()->getTitle()];
    }
}
{'fraction_non_alphanumeric': 0.18128512093818716, 'fraction_numerical': 0.003909113119960909, 'mean_word_length': 3.3231256599788805, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 89, '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': '7249652', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1155, 'n_words': 216}