@@ -214,9 +214,9 @@ public static function input(?string $prefix = null): string
214214 * // Do not provide options but requires a valid email
215215 * $email = CLI::prompt('What is your email?', null, 'required|valid_email');
216216 *
217- * @param string $field Output "field" question
218- * @param list<int|string>|string $options String to a default value, array to a list of options (the first option will be the default value)
219- * @param array |string|null $validation Validation rules
217+ * @param string $field Output "field" question
218+ * @param list<int|string>|string $options String to a default value, array to a list of options (the first option will be the default value)
219+ * @param list<string> |string|null $validation Validation rules
220220 *
221221 * @return string The user input
222222 */
@@ -273,10 +273,10 @@ public static function prompt(string $field, $options = null, $validation = null
273273 /**
274274 * prompt(), but based on the option's key
275275 *
276- * @param array |string $text Output "field" text or an one or two value array where the first value is the text before listing the options
277- * and the second value the text before asking to select one option. Provide empty string to omit
278- * @param array $options A list of options (array(key => description)), the first option will be the default value
279- * @param array |string|null $validation Validation rules
276+ * @param list<string> |string $text Output "field" text or an one or two value array where the first value is the text before listing the options
277+ * and the second value the text before asking to select one option. Provide empty string to omit
278+ * @param array<int|string, string> $options A list of options (array(key => description)), the first option will be the default value
279+ * @param list<string> |string|null $validation Validation rules
280280 *
281281 * @return string The selected key of $options
282282 */
@@ -302,11 +302,11 @@ public static function promptByKey($text, array $options, $validation = null): s
302302 /**
303303 * This method is the same as promptByKey(), but this method supports multiple keys, separated by commas.
304304 *
305- * @param string $text Output "field" text or an one or two value array where the first value is the text before listing the options
306- * and the second value the text before asking to select one option. Provide empty string to omit
307- * @param array $options A list of options (array(key => description)), the first option will be the default value
305+ * @param string $text Output "field" text or an one or two value array where the first value is the text before listing the options
306+ * and the second value the text before asking to select one option. Provide empty string to omit
307+ * @param array<int|string, string> $options A list of options (array(key => description)), the first option will be the default value
308308 *
309- * @return array The selected key(s) and value(s) of $options
309+ * @return array<int|string, string> The selected key(s) and value(s) of $options
310310 */
311311 public static function promptByMultipleKeys (string $ text , array $ options ): array
312312 {
@@ -375,6 +375,8 @@ public static function promptByMultipleKeys(string $text, array $options): array
375375
376376 /**
377377 * Validation for $options in promptByKey() and promptByMultipleKeys(). Return an error if $options is an empty array.
378+ *
379+ * @param array<int|string, string> $options
378380 */
379381 private static function isZeroOptions (array $ options ): void
380382 {
@@ -385,6 +387,8 @@ private static function isZeroOptions(array $options): void
385387
386388 /**
387389 * Print each key and value one by one
390+ *
391+ * @param array<int|string, string> $options
388392 */
389393 private static function printKeysAndValues (array $ options ): void
390394 {
@@ -404,9 +408,9 @@ private static function printKeysAndValues(array $options): void
404408 /**
405409 * Validate one prompt "field" at a time
406410 *
407- * @param string $field Prompt "field" output
408- * @param string $value Input value
409- * @param array |string $rules Validation rules
411+ * @param string $field Prompt "field" output
412+ * @param string $value Input value
413+ * @param list<string> |string $rules Validation rules
410414 */
411415 protected static function validate (string $ field , string $ value , $ rules ): bool
412416 {
@@ -1025,8 +1029,8 @@ public static function getOptionString(bool $useLongOpts = false, bool $trim = f
10251029 /**
10261030 * Returns a well formatted table
10271031 *
1028- * @param array $tbody List of rows
1029- * @param array $thead List of columns
1032+ * @param list< array<int|string, mixed>> $tbody List of rows
1033+ * @param list<string> $thead List of columns
10301034 *
10311035 * @return void
10321036 */
0 commit comments