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

Create install command #4

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix int check
  • Loading branch information
bennothommo committed Sep 11, 2020
commit c41f957297cf43c42e8dd5390fff232df822cc74
2 changes: 1 addition & 1 deletion src/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ protected function promptInt(string $question, ?int $default = null): int

$questionObj = new Question($prompt, $default);
$questionObj->setValidator(function ($answer) {
if (!is_int($answer)) {
if (!preg_match('/^(0|-?[1-9][0-9]*)$/', $answer)) {
throw new RuntimeException('Value must be a number');
}

Expand Down