<commit_before><?php
declare(strict_types=1);

namespace PerFi\PerFiBundle\EventListener;

use Avanzu\AdminThemeBundle\Event\SidebarMenuEvent;
use Avanzu\AdminThemeBundle\Model\MenuItemModel;
use Symfony\Component\HttpFoundation\Request;

class MenuItemListener
{
    public function onSetupMenu(SidebarMenuEvent $event)
    {
        $request = $event->getRequest();

        foreach ($this->getMenu($request) as $item) {
            $event->addItem($item);
        }
    }

    protected function getMenu(Request $request)
    {
        $menuItems = array(
            $homepage = new MenuItemModel('menu-homepage', 'Home', 'homepage', [], 'iconclasses fa fa-home'),
            $accounts = new MenuItemModel('menu-accounts', 'Accounts', null, [], 'iconclasses fa fa-bank'),
        );

        $accounts->addChild(
            new MenuItemModel('menu-list_accounts', 'List of accounts', 'accounts', [], 'iconclasses fa fa-list')
        );

        $accounts->addChild(
            new MenuItemModel('menu-create_account', 'Create account', 'create_account', [], 'iconclasses fa fa-plus')
        );

        return $this->activateByRoute($request->get('_route'), $menuItems);
    }

    protected function activateByRoute($route, $items)
    {
        foreach($items as $item) {
            if($item->hasChildren()) {
                $this->activateByRoute($route, $item->getChildren());
            } else {<commit_msg>Add transction menu item<commit_after><?php
declare(strict_types=1);

namespace PerFi\PerFiBundle\EventListener;

use Avanzu\AdminThemeBundle\Event\SidebarMenuEvent;
use Avanzu\AdminThemeBundle\Model\MenuItemModel;
use Symfony\Component\HttpFoundation\Request;

class MenuItemListener
{
    public function onSetupMenu(SidebarMenuEvent $event)
    {
        $request = $event->getRequest();

        foreach ($this->getMenu($request) as $item) {
            $event->addItem($item);
        }
    }

    protected function getMenu(Request $request)
    {
        $menuItems = array(
            $homepage = new MenuItemModel('menu-homepage', 'Home', 'homepage', [], 'iconclasses fa fa-home'),
            $transactions = new MenuItemModel('menu-transactions', 'Transactions', null, [], 'iconclasses fa fa-calculator'),
            $accounts = new MenuItemModel('menu-accounts', 'Accounts', null, [], 'iconclasses fa fa-bank'),
        );

        $accounts->addChild(
            new MenuItemModel('menu-list_accounts', 'List of accounts', 'accounts', [], 'iconclasses fa fa-list')
        );

        $accounts->addChild(
            new MenuItemModel('menu-create_account', 'Create account', 'create_account', [], 'iconclasses fa fa-plus')
        );

        return $this->activateByRoute($request->get('_route'), $menuItems);
    }

    protected function activateByRoute($route, $items)
    {
        foreach($items as $item) {
            if($item->hasChildren()) {
                $this->activateByRoute($route, $item->getChildren());
            } else {
{'fraction_non_alphanumeric': 0.1423785594639866, 'fraction_numerical': 0.0006700167504187605, 'mean_word_length': 3.013440860215054, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '2492844', 'n_tokens_mistral': 856, 'n_tokens_neox': 840, 'n_words': 167}