src/Factory/MenuFactory.php
public function createMenuItem(string $name, array $configuration, MenuConfiguration $parentConfiguration): MenuItem
    {
        // Resolve configuration for the current item
        $resolver = new OptionsResolver();
        $menuItemConfiguration = new MenuItemConfiguration($name, $parentConfiguration->getParameter('position'));
        $menuItemConfiguration->configureOptions($resolver);
        $resolvedConfiguration = $resolver->resolve($configuration);

        if ($this->applicationConfiguration->getParameter('enable_extra_configuration')) {
            $this->addExtraMenuItemConfiguration($resolvedConfiguration);
        }
        $menuItemConfiguration->setParameters($resolvedConfiguration);

        return new MenuItem($menuItemConfiguration);
    }
public function createMenuItem(string $name, array $configuration, MenuConfiguration $parentConfiguration): MenuItem
    {
        // Resolve configuration for the current item
        $resolver = new OptionsResolver();
        $menuItemConfiguration = new MenuItemConfiguration($name, $parentConfiguration->getParameter('position'));
        $menuItemConfiguration->configureOptions($resolver);
        $resolvedConfiguration = $resolver->resolve($configuration);

        if ($this->applicationConfiguration->getParameter('enable_extra_configuration')) {
            $this->addExtraMenuItemConfiguration($resolvedConfiguration);
        }
        $menuItemConfiguration->setParameters($resolvedConfiguration);

        return new MenuItem($menuItemConfiguration);
    }
public function createMenuItem ( string $ name , array $ configuration , MenuConfiguration $ parentConfiguration ) : MenuItem { // Resolve configuration for the current item $ resolver = new OptionsResolver ( ) ; $ menuItemConfiguration = new MenuItemConfiguration ( $ name , $ parentConfiguration -> getParameter ( 'position' ) ) ; $ menuItemConfiguration -> configureOptions ( $ resolver ) ; $ resolvedConfiguration = $ resolver -> resolve ( $ configuration ) ; if ( $ this -> applicationConfiguration -> getParameter ( 'enable_extra_configuration' ) ) { $ this -> addExtraMenuItemConfiguration ( $ resolvedConfiguration ) ; } $ menuItemConfiguration -> setParameters ( $ resolvedConfiguration ) ; return new MenuItem ( $ menuItemConfiguration ) ; }
Create a menu item according to the given configuration.

@param string            $name
@param array             $configuration
@param MenuConfiguration $parentConfiguration

@return MenuItem
Create a menu item according to the given configuration .