<commit_before><?php
use Menu\MenuBuilder\Menu;
use Menu\MenuBuilder\MenuInterface;
use Menu\MenuBuilder\MenuItemFactory;
use RolesCapabilities\Access\AccessFactory;

if ($menu instanceof MenuInterface) {
    if (!isset($menuType)) {
        $menuType = Menu::MENU_BUTTONS_TYPE;
    }

    $renderClass = 'Menu\\MenuBuilder\\Menu' . ucfirst($menuType) . 'Render';

    if (!class_exists($renderClass)) {
        throw new Exception('Menu render class [' . $renderClass . '] is not found!');
    }

    $render = new $renderClass($menu, $this);

    echo $render->render();
    return;
}

$menuBuilder = new Menu();
$accessFactory = new AccessFactory();
if (!isset($menuType)) {<commit_msg>Using arrays for menu is no longer encouraged (task #809)<commit_after><?php
use Menu\MenuBuilder\Menu;
use Menu\MenuBuilder\MenuInterface;
use Menu\MenuBuilder\MenuItemFactory;
use RolesCapabilities\Access\AccessFactory;

if ($menu instanceof MenuInterface) {
    if (!isset($menuType)) {
        $menuType = Menu::MENU_BUTTONS_TYPE;
    }

    $renderClass = 'Menu\\MenuBuilder\\Menu' . ucfirst($menuType) . 'Render';

    if (!class_exists($renderClass)) {
        throw new Exception('Menu render class [' . $renderClass . '] is not found!');
    }

    $render = new $renderClass($menu, $this);

    echo $render->render();
    return;
}

trigger_error('Using arrays for menu is deprecated.', E_USER_DEPRECATED);

$menuBuilder = new Menu();
$accessFactory = new AccessFactory();
if (!isset($menuType)) {
{'fraction_non_alphanumeric': 0.14696058784235136, 'fraction_numerical': 0.002004008016032064, 'mean_word_length': 4.1833910034602075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2960600', 'n_tokens_mistral': 464, 'n_tokens_neox': 451, 'n_words': 110}