File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33This document serves as a reference to upgrade your current cli-menu installation if improvements, deprecations
44or backwards compatibility (BC) breakages occur.
55
6+ ## 4.0.0
7+
8+ ### BC breaks
9+
10+ * Trait ` PhpSchool\CliMenu\MenuItem\SelectableTrait ` was removed. Copy the old code into your menu item
11+ if you need it.
12+ * Methods ` PhpSchool\CliMenu\Builder\CliMenuBuilder#setUnselectedMarker() ` & ` PhpSchool\CliMenu\Builder\CliMenuBuilder#setSelectedMarker() ` were removed.
13+ Customise markers on the individual item styles:
14+
15+ ``` php
16+ <?php
17+
18+ use PhpSchool\CliMenu\Builder\CliMenuBuilder;
19+ use PhpSchool\CliMenu\Style\SelectableStyle;
20+
21+ $menu = (new CliMenuBuilder)
22+ ->modifySelectableStyle(function (SelectableStyle $style) {
23+ $style->setUnselectedMarker('❅ ')
24+ ->setSelectedMarker('✏ ')
25+
26+ // disable unselected marker
27+ ->setUnselectedMarker('')
28+ ;
29+ })
30+ ->build();
31+ ```
32+ * Method getStyle() was added to interface PhpSchool\CliMenu\MenuItem\MenuItemInterface. Items must now implement this
33+ method. For selectable items use ` \PhpSchool\CliMenu\Style\SelectableStyle ` or a subclass of. For static items use
34+ ` \PhpSchool\CliMenu\Style\DefaultStyle ` or a subclass of.
35+ * ` PhpSchool\CliMenu\MenuStyle ` marker methods have been removed. If you were using these directly. Operate on the item
36+ style object instead.
37+
638## 3.0.0
739
840### BC breaks
@@ -78,4 +110,4 @@ $menu = (new CliMenuBuilder)
78110 ->build();
79111
80112$menu->open();
81- ```
113+ ```
You can’t perform that action at this time.
0 commit comments