public function removeMenuItem(MenuItemInterface $item): void
    {
        $key = array_search($item, $this->menuItems, true);
        if ($key !== false) {
            unset($this->menuItems[$key]);
        }
    }