public function removeMenuItem(MenuItemInterface $item): void
    {
        $key = array_search($item, $this->menuItems, true);
        if ($key !== false) {
            unset($this->menuItems[$key]);
        }
    }
public function removeMenuItem(MenuItemInterface $item): void
    {
        $key = array_search($item, $this->menuItems, true);
        if ($key !== false) {
            unset($this->menuItems[$key]);
        }
    }
public function removeMenuItem ( MenuItemInterface $ item ) : void { $ key = array_search ( $ item , $ this -> menuItems , true ) ; if ( $ key !== false ) { unset ( $ this -> menuItems [ $ key ] ) ; } }
Removes the specified menu item from this container.
If the provided item is not in this container, this method does nothing.

@param MenuItemInterface $item  The item to be removed from the menu.
@return void
Removes the specified menu item from this container . If the provided item is not in this container this method does nothing .