<commit_before><?php

namespace Opensixt\BikiniTranslateBundle\Menu;

use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\HttpFoundation\Request;

class MenuBuilder
{
    /** @var FactoryInterface */
    public $factory;

    /** @var \Symfony\Bundle\FrameworkBundle\Translation\Translator */
    public $translator;

    /** @var \Symfony\Component\EventDispatcher\EventDispatcher */
    public $eventDispatcher;

    /** @var \Symfony\Component\Security\Core\SecurityContext */
    public $securityContext;

    /**
     * @param Request $request
     * @return ItemInterface
     */
    public function createSidebarMenu(Request $request)
    {
        $menu = $this->factory->createItem('root')
            ->setChildrenAttribute('id', 'nav');

        $menu->addChild($this->translator->trans('admin_home'), array('route' => '_user_admin_home'));

        if ($this->securityContext->isGranted('ROLE_USER')) {
            //$menu->setCurrentUri($request->getRequestUri());
<commit_msg>- set dashboard,login and logout menuitems<commit_after><?php

namespace Opensixt\BikiniTranslateBundle\Menu;

use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\HttpFoundation\Request;

class MenuBuilder
{
    /** @var FactoryInterface */
    public $factory;

    /** @var \Symfony\Bundle\FrameworkBundle\Translation\Translator */
    public $translator;

    /** @var \Symfony\Component\EventDispatcher\EventDispatcher */
    public $eventDispatcher;

    /** @var \Symfony\Component\Security\Core\SecurityContext */
    public $securityContext;

    /**
     * @param Request $request
     * @return ItemInterface
     */
    public function createSidebarMenu(Request $request)
    {
        $menu = $this->factory->createItem('root')
            ->setChildrenAttribute('id', 'nav');

        if ($this->securityContext->isGranted('IS_AUTHENTICATED_FULLY')) {
            $menu->addChild($this->translator->trans('admin_home'), array('route' => '_user_admin_home'));
            $menu->addChild($this->translator->trans('logout'), array('route' => '_logout'))
                ->setAttribute('class', 'pull-right');
        } else {
            $menu->addChild($this->translator->trans('login'), array('route' => '_login'))
                ->setAttribute('class', 'pull-right');
        }

        if ($this->securityContext->isGranted('ROLE_USER')) {
            //$menu->setCurrentUri($request->getRequestUri());

{'fraction_non_alphanumeric': 0.1552492906364005, 'fraction_numerical': 0.0, 'mean_word_length': 3.329824561403509, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '7586195', 'n_tokens_mistral': 716, 'n_tokens_neox': 695, 'n_words': 110}