From 310151c6f31e6f1300289585ac82b1486337f8b9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Sep 2023 16:30:39 +0900 Subject: [PATCH 1/3] docs: fix typo --- system/CLI/CLI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php index 29f424d1ec53..ae1e92d7cf44 100644 --- a/system/CLI/CLI.php +++ b/system/CLI/CLI.php @@ -448,7 +448,7 @@ public static function print(string $text = '', ?string $foreground = null, ?str } /** - * Outputs a string to the cli on it's own line. + * Outputs a string to the cli on its own line. * * @return void */ @@ -834,7 +834,7 @@ public static function showProgress($thisStep = 1, int $totalSteps = 10) * width. * * If an int is passed into $pad_left, then all strings after the first - * will padded with that many spaces to the left. Useful when printing + * will pad with that many spaces to the left. Useful when printing * short descriptions that need to start on an existing line. */ public static function wrap(?string $string = null, int $max = 0, int $padLeft = 0): string From fd6e698ead721a727f1a3e76632586dc81de5d98 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Sep 2023 17:55:55 +0900 Subject: [PATCH 2/3] docs: fix @param --- system/CLI/CLI.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php index ae1e92d7cf44..3fc5f32304f7 100644 --- a/system/CLI/CLI.php +++ b/system/CLI/CLI.php @@ -179,7 +179,7 @@ public static function init() * Named options must be in the following formats: * php index.php user -v --v -name=John --name=John * - * @param string $prefix You may specify a string with which to prompt the user. + * @param string|null $prefix You may specify a string with which to prompt the user. */ public static function input(?string $prefix = null): string { @@ -210,9 +210,9 @@ public static function input(?string $prefix = null): string * // Do not provide options but requires a valid email * $email = CLI::prompt('What is your email?', null, 'required|valid_email'); * - * @param string $field Output "field" question - * @param array|string $options String to a default value, array to a list of options (the first option will be the default value) - * @param array|string $validation Validation rules + * @param string $field Output "field" question + * @param array|string $options String to a default value, array to a list of options (the first option will be the default value) + * @param array|string|null $validation Validation rules * * @return string The user input * @@ -574,10 +574,10 @@ public static function clearScreen() * Returns the given text with the correct color codes for a foreground and * optionally a background color. * - * @param string $text The text to color - * @param string $foreground The foreground color - * @param string $background The background color - * @param string $format Other formatting to apply. Currently only 'underline' is understood + * @param string $text The text to color + * @param string $foreground The foreground color + * @param string|null $background The background color + * @param string|null $format Other formatting to apply. Currently only 'underline' is understood * * @return string The color coded string */ From cbeb86f5b6275e45ca3e0f4bd9a459ebd3dbfa86 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 26 Sep 2023 08:21:47 +0900 Subject: [PATCH 3/3] fix: CLI prompt message --- system/CLI/CLI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php index 3fc5f32304f7..7a095b937fe6 100644 --- a/system/CLI/CLI.php +++ b/system/CLI/CLI.php @@ -258,7 +258,7 @@ public static function prompt(string $field, $options = null, $validation = null $input = trim(static::input()) ?: $default; if ($validation) { - while (! static::validate(trim($field), $input, $validation)) { + while (! static::validate('"' . trim($field) . '"', $input, $validation)) { $input = static::prompt($field, $options, $validation); } }