<commit_before><?php

namespace Bootstrap\Components\AppzioUiKit\Navigation;
use Bootstrap\Components\BootstrapComponent;

trait uiKitMenuItem
{

    public function uiKitMenuItem($item = [], $parameters = [], $styles = []) {

        if ( !isset($item['label']) ) {
            return $this->getComponentText('{#missing_label#}', [
                'style' => 'article-uikit-error'
            ]);
        }

        if ( isset($item['icon']) AND $item['icon'] ) {
            $menu_content[] = $this->getComponentImage($item['icon'], [
                'style' => 'uikit_menu_item_image'
            ]);
        }

        $menu_content[] = $this->getComponentText($item['label'], [
            'style' => 'uikit_menu_item_label'
        ]);

        return $this->getComponentRow($menu_content, $this->getParameters( $item, $parameters ));
    }

    protected function getParameters( $item, $parameters ) {

        if ( empty($parameters['style']) ) {
            $parameters['style'] = 'uikit_menu_item_row';
        }

        if ( !isset($item['link']) OR empty($item['link']) ) {
            return $parameters;
        }

        $click['onclick'] = $this->getOnclickOpenAction( $item['link'] );

        return array_merge($parameters, $click);
    }

}<commit_msg>Updated menu item component.<commit_after><?php

namespace Bootstrap\Components\AppzioUiKit\Navigation;
use Bootstrap\Components\BootstrapComponent;

trait uiKitMenuItem
{

    public function uiKitMenuItem($item = [], $parameters = [], $styles = []) {

        if ( !isset($item['name']) ) {
            return $this->getComponentText('{#missing_name#}', [
                'style' => 'article-uikit-error'
            ]);
        }

        if ( isset($item['icon']) AND $item['icon'] ) {
            $menu_content[] = $this->getComponentImage($item['icon'], [
                'style' => 'uikit_menu_item_image'
            ]);
        }

        $menu_content[] = $this->getComponentText($item['name'], [
            'style' => 'uikit_menu_item_label'
        ]);

        return $this->getComponentRow($menu_content, $this->getParameters( $item, $parameters ));
    }

    protected function getParameters( $item, $parameters ) {

        if ( empty($parameters['style']) ) {
            $parameters['style'] = 'uikit_menu_item_row';
        }

        if ( !isset($item['link']) OR empty($item['link']) ) {
            return $parameters;
        }

        if ( is_numeric($item['link']) ) {
            $click['onclick'] = $this->getOnclickOpenAction(false, $item['link']);
        } else {
            $click['onclick'] = $this->getOnclickOpenAction( $item['link'] );
        }

        return array_merge($parameters, $click);
    }

}
{'fraction_non_alphanumeric': 0.1722488038277512, 'fraction_numerical': 0.0, 'mean_word_length': 2.480153649167734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '1080362', 'n_tokens_mistral': 809, 'n_tokens_neox': 787, 'n_words': 121}