From a94a7512d6bfd955df4cd64e8fee15229bdf91a6 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 17 Dec 2022 22:03:19 +0100 Subject: [PATCH] Conditional return type for `IOInterface::select()` (#11219) --- src/Composer/IO/IOInterface.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/IO/IOInterface.php b/src/Composer/IO/IOInterface.php index d6f698649..88b1cd46c 100644 --- a/src/Composer/IO/IOInterface.php +++ b/src/Composer/IO/IOInterface.php @@ -191,7 +191,9 @@ interface IOInterface extends LoggerInterface * @param bool $multiselect Select more than one value separated by comma * * @throws \InvalidArgumentException + * * @return int|string|list|bool The selected value or values (the key of the choices array) + * @phpstan-return ($multiselect is true ? list : string|int|bool) */ public function select(string $question, array $choices, $default, $attempts = false, string $errorMessage = 'Value "%s" is invalid', bool $multiselect = false);