File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,12 @@ class CliMenuBuilder
32
32
private $ parent ;
33
33
34
34
/**
35
- * @var self[]|CliMenu[]
35
+ * @var self[]
36
+ */
37
+ private $ subMenuBuilders = [];
38
+
39
+ /**
40
+ * @var CliMenu[]
36
41
*/
37
42
private $ subMenus = [];
38
43
@@ -147,10 +152,10 @@ public function addAsciiArt(string $art, string $position = AsciiArtItem::POSITI
147
152
*/
148
153
public function addSubMenu (string $ id ) : CliMenuBuilder
149
154
{
150
- $ this ->menuItems [] = $ id ;
151
- $ this ->subMenus [$ id ] = new static ($ this );
155
+ $ this ->menuItems [] = $ id ;
156
+ $ this ->subMenuBuilders [$ id ] = new static ($ this );
152
157
153
- return $ this ->subMenus [$ id ];
158
+ return $ this ->subMenuBuilders [$ id ];
154
159
}
155
160
156
161
/**
@@ -353,7 +358,7 @@ private function buildSubMenus(array $items) : array
353
358
return $ item ;
354
359
}
355
360
356
- $ menuBuilder = $ this ->subMenus [$ item ];
361
+ $ menuBuilder = $ this ->subMenuBuilders [$ item ];
357
362
$ this ->subMenus [$ item ] = $ menuBuilder ->build ();
358
363
359
364
return new MenuMenuItem ($ item , $ this ->subMenus [$ item ], $ menuBuilder ->isMenuDisabled ());
You can’t perform that action at this time.
0 commit comments