From 0cf57255d4b8ebcf915fea9151d062498acb22c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 24 Nov 2022 13:59:33 +0100 Subject: [PATCH] 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`, making it more explicit in terms of static code analysis. --- src/Composer/IO/IOInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/IO/IOInterface.php b/src/Composer/IO/IOInterface.php index 91c239ff4..d6f698649 100644 --- a/src/Composer/IO/IOInterface.php +++ b/src/Composer/IO/IOInterface.php @@ -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|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);