<commit_before><?php

use Cake\Event\Event;
use Menu\MenuBuilder\MainMenuRenderAdminLte;
use Menu\MenuBuilder\Menu;
use Menu\MenuBuilder\MenuItemFactory;
use Menu\MenuBuilder\SystemMenuRenderAdminLte;

$event = new Event('Menu.Menu.beforeRender', $this, ['menu' => $menuItems, 'user' => $user]);
$this->eventManager()->dispatch($event);
if (!empty($event->result)) {
    $menuItems = $event->result;
}

$menu = new Menu();
foreach ($menuItems as $item) {
    $menuItem = MenuItemFactory::createMenuItem($item);
    $menu->addMenuItem($menuItem);
}

if ($name == 'main_menu') {
    $menu->title('<li class="header">MAIN NAVIGATION</li>');
    $renderClass = 'Menu\\MenuBuilder\\MainMenuRenderAdminLte';
} else {
    $renderClass = 'Menu\\MenuBuilder\\SystemMenuRenderAdminLte';
}

$render = new $renderClass($menu);
echo $render->render();<commit_msg>Sent view entity as parameter to menu entity - task #809<commit_after><?php

use Cake\Event\Event;
use Menu\MenuBuilder\MainMenuRenderAdminLte;
use Menu\MenuBuilder\Menu;
use Menu\MenuBuilder\MenuItemFactory;
use Menu\MenuBuilder\SystemMenuRenderAdminLte;

$event = new Event('Menu.Menu.beforeRender', $this, ['menu' => $menuItems, 'user' => $user]);
$this->eventManager()->dispatch($event);
if (!empty($event->result)) {
    $menuItems = $event->result;
}

$menu = new Menu();
foreach ($menuItems as $item) {
    $menuItem = MenuItemFactory::createMenuItem($item);
    $menu->addMenuItem($menuItem);
}

if ($name == 'main_menu') {
    $menu->title('<li class="header">MAIN NAVIGATION</li>');
    $renderClass = 'Menu\\MenuBuilder\\MainMenuRenderAdminLte';
} else {
    $renderClass = 'Menu\\MenuBuilder\\SystemMenuRenderAdminLte';
}

$render = new $renderClass($menu, $this);
echo $render->render();
{'fraction_non_alphanumeric': 0.18057142857142858, 'fraction_numerical': 0.0017142857142857142, 'mean_word_length': 5.708812260536399, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, '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': '1346531', 'n_tokens_mistral': 567, 'n_tokens_neox': 562, 'n_words': 109}