Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept any callable as argument for addSubMenu and addSplitItem in CliMenuBuilder #275

Merged
merged 2 commits into from
Aug 27, 2023

Conversation

simonorono
Copy link
Contributor

While working on a personal project I was structuring all actions to be callable objects (using the __invoke method) and stumbled upon the addSubMenu method not accepting them as a callback. This PR modifies the argument type so it accepts any callable as defined here

@codecov
Copy link

codecov bot commented Aug 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0cdb162) 93.46% compared to head (ea2986a) 93.46%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #275   +/-   ##
=========================================
  Coverage     93.46%   93.46%           
  Complexity      656      656           
=========================================
  Files            38       38           
  Lines          2021     2021           
=========================================
  Hits           1889     1889           
  Misses          132      132           
Files Changed Coverage Δ
src/Builder/CliMenuBuilder.php 76.07% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AydinHassan
Copy link
Member

Nice thanks, do you think you could also update addSplitItem in the same manner?

@simonorono
Copy link
Contributor Author

Nice thanks, do you think you could also update addSplitItem in the same manner?

Just did it.

@simonorono simonorono changed the title Accept any callable as argument for addSubMenu in CliMenuBuilder Accept any callable as argument for addSubMenu and addSplitItem in CliMenuBuilder Aug 27, 2023
@AydinHassan AydinHassan merged commit 835c28e into php-school:master Aug 27, 2023
13 checks passed
@AydinHassan
Copy link
Member

Thanks @simonorono !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants