php-school / cli-menu

🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.
http://www.phpschool.io
MIT License
1.94k stars 106 forks source link

Item extra toggling support #187

Closed AydinHassan closed 4 years ago

AydinHassan commented 4 years ago

@jtreminio would this solve the problem for you?

Basically we previously inferred whether to display item extra based on the items in the menu. If no items displayed item extra then we disabled it globally.

I've added a method to the builder to force display item extra and if you customise the item extra text it will enable it globally also.

/cc @mikeymike @polothy (only two years late :D)

I'll add some tests and docs if everyone is happy with this.

codecov-io commented 4 years ago

Codecov Report

Merging #187 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #187      +/-   ##
============================================
+ Coverage     93.19%   93.22%   +0.02%     
- Complexity      486      488       +2     
============================================
  Files            27       27              
  Lines          1470     1475       +5     
============================================
+ Hits           1370     1375       +5     
  Misses          100      100
Impacted Files Coverage Δ Complexity Δ
src/Builder/CliMenuBuilder.php 84.07% <100%> (+0.4%) 67 <1> (+2) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3c4db90...b2febc9. Read the comment docs.

mikeymike commented 4 years ago

seems fair to me 👍

jtreminio commented 4 years ago

Looks like this solves the issue.