1
0
Fork 0

Make possible return type in `IOInterface::select()` more explicit (#11171)

`IOInterface::select()` either returns any of `int`, `string`, `bool` or an
array of `string` values. However, since the returned array is always a
list, we can safely change the return type annotation to `list<string>`,
making it more explicit in terms of static code analysis.
pull/11229/head
Elias Häußler 2022-11-24 13:59:33 +01:00 committed by GitHub
parent bd6a5019b3
commit 0cf57255d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -191,7 +191,7 @@ interface IOInterface extends LoggerInterface
* @param bool $multiselect Select more than one value separated by comma
*
* @throws \InvalidArgumentException
* @return int|string|string[]|bool The selected value or values (the key of the choices array)
* @return int|string|list<string>|bool The selected value or values (the key of the choices array)
*/
public function select(string $question, array $choices, $default, $attempts = false, string $errorMessage = 'Value "%s" is invalid', bool $multiselect = false);