We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee8fc9c commit 4fcd491Copy full SHA for 4fcd491
src/Symfony/Component/Console/Question/Question.php
@@ -188,8 +188,11 @@ public function getValidator()
188
*/
189
public function setMaxAttempts($attempts)
190
{
191
- if (null !== $attempts && $attempts < 1) {
192
- throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
+ if (null !== $attempts) {
+ $attempts = (int) $attempts;
193
+ if ($attempts < 1) {
194
+ throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
195
+ }
196
}
197
198
$this->attempts = $attempts;
0 commit comments