Skip to content

Commit

Permalink
[Console] Fix SymfonyStyle::ask usage
Browse files Browse the repository at this point in the history
Use function "ctype_digit" instead of "is_integer" because "$number" is not an integer value, but a string
  • Loading branch information
liviubalan authored May 7, 2018
1 parent 9dbd4f5 commit 38bcfcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion console/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ User Input Methods
the third argument::

$io->ask('Number of workers to start', 1, function ($number) {
if (!is_integer($number)) {
if (!ctype_digit($number)) {
throw new \RuntimeException('You must type an integer.');
}

Expand Down

0 comments on commit 38bcfcb

Please sign in to comment.