framework icon indicating copy to clipboard operation
framework copied to clipboard

[9.x] Mistake in console choice phpdoc

Open mro95 opened this issue 3 years ago • 0 comments

Writing a console command, there is a function $this->choice(). The $default property should be the default key as described in the Laravel documentation, which is int and not string.

mro95 avatar Aug 10 '22 09:08 mro95

When choice is passed an associated array, a string is a valid value here.

$day = $this->choice(
    'What day is it?',
    [
       'mon' => 'Monday',
       'tues' => 'Tuesday'
    ],
    'mon'
);

Likely, it should be null|string|int

timacdonald avatar Aug 11 '22 00:08 timacdonald

Thanks!

driesvints avatar Aug 11 '22 06:08 driesvints