Skip to content

Commit

Permalink
Merge pull request #275 from simonorono/callable_for_submenu
Browse files Browse the repository at this point in the history
Accept any callable as argument for addSubMenu and addSplitItem in CliMenuBuilder
  • Loading branch information
AydinHassan committed Aug 27, 2023
2 parents 0cdb162 + ea2986a commit 835c28e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Builder/CliMenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function addAsciiArt(string $art, string $position = AsciiArtItem::POSITI
return $this;
}

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

Expand Down Expand Up @@ -315,7 +315,7 @@ private function processIndividualShortcut(MenuItemInterface $item, callable $ca
}
}

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

Expand Down

0 comments on commit 835c28e

Please sign in to comment.