diff --git a/console/style.rst b/console/style.rst index 6587bd9b09a..2b36e3862b9 100644 --- a/console/style.rst +++ b/console/style.rst @@ -238,11 +238,11 @@ User Input Methods the third argument:: $io->ask('Number of workers to start', 1, function ($number) { - if (!is_integer($number)) { - throw new \RuntimeException('You must type an integer.'); + if (!is_numeric($number)) { + throw new \RuntimeException('You must type a number.'); } - return $number; + return (int) $number; }); :method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::askHidden`