public function buildMenus(MenuEvent $event)
    {
        if (!$this->applicationConfiguration->getParameter('enable_menus')) {
            return;
        }
        $menuConfigurations = array_merge_recursive(
            $this->adminMenuConfigurations,
            $event->getMenuConfigurations()
        );
        $configurationEvent = new MenuConfigurationEvent($menuConfigurations);

        // Dispatch a pre-menu build event to allow dynamic configuration modifications
        $this
            ->eventDispatcher
            ->dispatch(Events::MENU_CONFIGURATION, $configurationEvent)
        ;
        $menuConfigurations = $configurationEvent->getMenuConfigurations();

        foreach ($menuConfigurations as $name => $menuConfiguration) {
            $this->menuFactory->create($name, $menuConfiguration);
        }
    }