Skip to content

Adding the ability to ask a question on the printer#60

Merged
JustSteveKing merged 2 commits into
mainfrom
feature/asking-for-input
May 2, 2023
Merged

Adding the ability to ask a question on the printer#60
JustSteveKing merged 2 commits into
mainfrom
feature/asking-for-input

Conversation

@JustSteveKing

Copy link
Copy Markdown
Collaborator

This PR adds the ability to ask for user input on the printer, this is a Developer Experience improvement that makes this logic easier to perform.

Previously we would have to:

$app->registerCommand('mycommand', function(CommandCall $input) use ($app) {
      $question = $this->display('Here is a question');

    $response = (new Input())->read();

   // Do something with the input.
});

Now we can do this a little simpler:

$app->registerCommand('mycommand', function(CommandCall $input) use ($app) {
    $response = $this->ask('Here is a question');
   
    // Do something with the input.
});

@JustSteveKing JustSteveKing added the enhancement New feature or request label May 1, 2023
@JustSteveKing JustSteveKing self-assigned this May 1, 2023
@JustSteveKing JustSteveKing requested a review from erikaheidi May 1, 2023 20:43

@erikaheidi erikaheidi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, a lot easier definitely. thanks Steve!

@JustSteveKing JustSteveKing merged commit 80d7957 into main May 2, 2023
@JustSteveKing JustSteveKing deleted the feature/asking-for-input branch May 2, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants