From dc5b9f346e9a77ce96c9586eb78b2d79ac9bef71 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 24 Jul 2024 20:53:12 +0200 Subject: [PATCH] Updated the interface --- UPGRADE.md | 14 ++++++++++++++ src/Contracts/Menu/MenuItemMatcherInterface.php | 10 +++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index ed10dae626..675631ba26 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,6 +1,20 @@ Upgrade between EasyAdmin 4.x versions ====================================== +EasyAdmin 4.11.0 +---------------- + +### Updated the `MenuItemMatcherInterface` + +The `MenuItemMatcherInterface` has changed as follows: + + * The `isSelected(MenuItemDto $menuItemDto)` has been removed + * The `isExpanded(MenuItemDto $menuItemDto)` method has been added + * A new `markSelectedMenuItem(array $menuItems)` method has been added + +Read the comments in the code of the `MenuItemMatcher` class to learn about the +new menu item matching logic. + EasyAdmin 4.10.0 ---------------- diff --git a/src/Contracts/Menu/MenuItemMatcherInterface.php b/src/Contracts/Menu/MenuItemMatcherInterface.php index 203e4e0899..99f89f5051 100644 --- a/src/Contracts/Menu/MenuItemMatcherInterface.php +++ b/src/Contracts/Menu/MenuItemMatcherInterface.php @@ -10,12 +10,8 @@ interface MenuItemMatcherInterface { /** - * @return bool Returns true when this menu item is the selected one + * @param MenuItemDto[] $menuItems + * @return MenuItemDto[] */ - public function isSelected(MenuItemDto $menuItemDto): bool; - - /** - * @return bool Returns true when any of the subitems of the menu item is selected - */ - public function isExpanded(MenuItemDto $menuItemDto): bool; + public function markSelectedMenuItem(array $menuItems): array; }