<commit_before><ul>
<?php foreach (['home' => $this->t('Home'), 'configurations' => $this->t('Configurations'), 'account' => $this->t('Account'), 'documentation' => $this->t('Documentation')] as $menuKey => $menuText): ?>
<?php if ($menuKey === $activeItem): ?>
    <li class="active">
<?php else: ?>
    <li>
<?php endif; ?>
        <a href="<?=$this->e($menuKey); ?>"><?=$menuText; ?></a>
    </li>
<?php endforeach; ?>
<?php if ($isAdmin): ?>
<?php foreach (['connections' => $this->t('Connections'), 'users' => $this->t('Users'), 'info' => $this->t('Info'), 'stats' => $this->t('Stats'), 'messages' => $this->t('Messages'), 'log' => $this->t('Log')] as $menuKey => $menuText): ?>
<?php if ($menuKey === $activeItem): ?>
    <li class="active">
<?php else: ?>
    <li>
<?php endif; ?>
        <a href="<?=$this->e($menuKey); ?>"><?=$menuText; ?></a>
    </li>
<?php endforeach; ?>
<?php endif; ?>
</ul><commit_msg>rework menu, reduce code duplication and make it easier to add optional items<commit_after><?php
$menuItems = [];
$menuItems['home'] = $this->t('Home');
$menuItems['configurations'] = $this->t('Configurations');
$menuItems['account'] = $this->t('Account');
$menuItems['documentation'] = $this->t('Documentation');
if ($isAdmin) {
    $menuItems['connections'] = $this->t('Connections');
    $menuItems['users'] = $this->t('Users');
    $menuItems['info'] = $this->t('Info');
    $menuItems['stats'] = $this->t('Stats');
    $menuItems['messages'] = $this->t('Messages');
    $menuItems['log'] = $this->t('Log');
}
?>
<ul>
<?php foreach ($menuItems as $menuKey => $menuText): ?>
<?php if ($menuKey === $activeItem): ?>
    <li class="active">
<?php else: ?>
    <li>
<?php endif; ?>
        <a href="<?=$this->e($menuKey); ?>"><?=$menuText; ?></a>
    </li>
<?php endforeach; ?>
</ul>
{'fraction_non_alphanumeric': 0.29555555555555557, 'fraction_numerical': 0.0, 'mean_word_length': 5.063973063973064, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 82, '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': '5124987', 'n_tokens_mistral': 628, 'n_tokens_neox': 628, 'n_words': 134}