@@ -196,9 +196,9 @@ public static function input(?string $prefix = null): string
196196 * // Do not provide options but requires a valid email
197197 * $email = CLI::prompt('What is your email?', null, 'required|valid_email');
198198 *
199- * @param string $field Output "field" question
200- * @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)
201- * @param array |string|null $validation Validation rules
199+ * @param string $field Output "field" question
200+ * @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)
201+ * @param list<string> |string|null $validation Validation rules
202202 *
203203 * @return string The user input
204204 */
@@ -255,10 +255,10 @@ public static function prompt(string $field, $options = null, $validation = null
255255 /**
256256 * prompt(), but based on the option's key
257257 *
258- * @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
259- * and the second value the text before asking to select one option. Provide empty string to omit
260- * @param array $options A list of options (array(key => description)), the first option will be the default value
261- * @param array |string|null $validation Validation rules
258+ * @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
259+ * and the second value the text before asking to select one option. Provide empty string to omit
260+ * @param array<int|string, string> $options A list of options (array(key => description)), the first option will be the default value
261+ * @param list<string> |string|null $validation Validation rules
262262 *
263263 * @return string The selected key of $options
264264 */
@@ -284,11 +284,11 @@ public static function promptByKey($text, array $options, $validation = null): s
284284 /**
285285 * This method is the same as promptByKey(), but this method supports multiple keys, separated by commas.
286286 *
287- * @param string $text Output "field" text or an one or two value array where the first value is the text before listing the options
288- * and the second value the text before asking to select one option. Provide empty string to omit
289- * @param array $options A list of options (array(key => description)), the first option will be the default value
287+ * @param string $text Output "field" text or an one or two value array where the first value is the text before listing the options
288+ * and the second value the text before asking to select one option. Provide empty string to omit
289+ * @param array<int|string, string> $options A list of options (array(key => description)), the first option will be the default value
290290 *
291- * @return array The selected key(s) and value(s) of $options
291+ * @return array<int|string, string> The selected key(s) and value(s) of $options
292292 */
293293 public static function promptByMultipleKeys (string $ text , array $ options ): array
294294 {
@@ -357,6 +357,8 @@ public static function promptByMultipleKeys(string $text, array $options): array
357357
358358 /**
359359 * Validation for $options in promptByKey() and promptByMultipleKeys(). Return an error if $options is an empty array.
360+ *
361+ * @param array<int|string, string> $options
360362 */
361363 private static function isZeroOptions (array $ options ): void
362364 {
@@ -367,6 +369,8 @@ private static function isZeroOptions(array $options): void
367369
368370 /**
369371 * Print each key and value one by one
372+ *
373+ * @param array<int|string, string> $options
370374 */
371375 private static function printKeysAndValues (array $ options ): void
372376 {
@@ -386,9 +390,9 @@ private static function printKeysAndValues(array $options): void
386390 /**
387391 * Validate one prompt "field" at a time
388392 *
389- * @param string $field Prompt "field" output
390- * @param string $value Input value
391- * @param array |string $rules Validation rules
393+ * @param string $field Prompt "field" output
394+ * @param string $value Input value
395+ * @param list<string> |string $rules Validation rules
392396 */
393397 protected static function validate (string $ field , string $ value , $ rules ): bool
394398 {
@@ -1027,8 +1031,8 @@ public static function getOptionString(bool $useLongOpts = false, bool $trim = f
10271031 /**
10281032 * Returns a well formatted table
10291033 *
1030- * @param array $tbody List of rows
1031- * @param array $thead List of columns
1034+ * @param list< array<int|string, mixed>> $tbody List of rows
1035+ * @param list<string> $thead List of columns
10321036 *
10331037 * @return void
10341038 */
0 commit comments