Skip to content

Commit 835c28e

Browse files
authored
Merge pull request #275 from simonorono/callable_for_submenu
Accept any callable as argument for addSubMenu and addSplitItem in CliMenuBuilder
2 parents 0cdb162 + ea2986a commit 835c28e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Builder/CliMenuBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function addAsciiArt(string $art, string $position = AsciiArtItem::POSITI
205205
return $this;
206206
}
207207

208-
public function addSubMenu(string $text, \Closure $callback) : self
208+
public function addSubMenu(string $text, callable $callback) : self
209209
{
210210
$builder = self::newSubMenu($this->terminal);
211211

@@ -315,7 +315,7 @@ private function processIndividualShortcut(MenuItemInterface $item, callable $ca
315315
}
316316
}
317317

318-
public function addSplitItem(\Closure $callback) : self
318+
public function addSplitItem(callable $callback) : self
319319
{
320320
$builder = new SplitItemBuilder($this->menu);
321321

0 commit comments

Comments
 (0)