Skip to content

Commit 1185f28

Browse files
committed
Assert the type is one of two supported menus
The ternary logic used in the class requires that only one of these two classes are used
1 parent 0668a81 commit 1185f28

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class NavigationMenuGenerator
3737
/** @param class-string<\Hyde\Framework\Features\Navigation\NavigationMenu> $menuType */
3838
protected function __construct(string $menuType)
3939
{
40+
assert(in_array($menuType, [NavigationMenu::class, DocumentationSidebar::class]));
41+
4042
$this->menuType = $menuType;
4143

4244
$this->items = new Collection();

0 commit comments

Comments
 (0)