Skip to content

Adds the ability to add multiple checkbox and radio items #241

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

Merged
merged 1 commit into from
Jan 11, 2021
Merged

Adds the ability to add multiple checkbox and radio items #241

merged 1 commit into from
Jan 11, 2021

Conversation

octoper
Copy link
Contributor

@octoper octoper commented Jan 11, 2021

This PR adds the ability to add multipe checkbox and radio items at once.

Examples:

Checkbox

<?php

use PhpSchool\CliMenu\Builder\CliMenuBuilder;
use PhpSchool\CliMenu\CliMenu;

$callable = function (CliMenu $menu) {
    echo 'I am alive!';
};

$menu = (new CliMenuBuilder)
    ->addCheckboxItems([
        ['Item 1', $callable],
        ['Item 2', $callable],
        ['Item 3', $callable],
    ])
    ->build();

Radio

<?php

use PhpSchool\CliMenu\Builder\CliMenuBuilder;
use PhpSchool\CliMenu\CliMenu;

$callable = function (CliMenu $menu) {
    echo 'I am alive!';
};

$menu = (new CliMenuBuilder)
    ->addRadioItems([
        ['Item 1', $callable],
        ['Item 2', $callable],
        ['Item 3', $callable],
    ])
    ->build();

Copy link
Member

@mikeymike mikeymike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, We'll wait for CI to run but this looks like a nice addition cc @AydinHassan

@AydinHassan
Copy link
Member

@octoper thanks for the perfect pr, tests, docs, examples. Will merge when travis runs, probably next week at this rate (it's very slow) 😭

@octoper
Copy link
Contributor Author

octoper commented Jan 11, 2021

Thinking about making a PR to move from TravisCI to GitHub actions if it's good with you 😅

@AydinHassan
Copy link
Member

I did try before but there were some problems with the tty stuff we do. It is definitely welcome if you would like to have a crack!

@octoper
Copy link
Contributor Author

octoper commented Jan 11, 2021

cc @AydinHassan hopefully TravisCI passed 😅

@AydinHassan AydinHassan merged commit 31fc3d4 into php-school:master Jan 11, 2021
@AydinHassan
Copy link
Member

Thanks @octoper !

@octoper
Copy link
Contributor Author

octoper commented Jan 11, 2021

Do you need both https://codecov.io and https://scrutinizer-ci.com ? (sorry that I'm mention that here but I don't know how to contact you) cc @AydinHassan

@mikeymike
Copy link
Member

@octoper feel free to join us on Slack https://phpschool.herokuapp.com/

@AydinHassan
Copy link
Member

We can drop scrutinizer, we have done for the other repos 🙂

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.

3 participants