@@ -179,7 +179,7 @@ public static function init()
179
179
* Named options must be in the following formats:
180
180
* php index.php user -v --v -name=John --name=John
181
181
*
182
- * @param string $prefix You may specify a string with which to prompt the user.
182
+ * @param string|null $prefix You may specify a string with which to prompt the user.
183
183
*/
184
184
public static function input (?string $ prefix = null ): string
185
185
{
@@ -210,9 +210,9 @@ public static function input(?string $prefix = null): string
210
210
* // Do not provide options but requires a valid email
211
211
* $email = CLI::prompt('What is your email?', null, 'required|valid_email');
212
212
*
213
- * @param string $field Output "field" question
214
- * @param array|string $options String to a default value, array to a list of options (the first option will be the default value)
215
- * @param array|string $validation Validation rules
213
+ * @param string $field Output "field" question
214
+ * @param array|string $options String to a default value, array to a list of options (the first option will be the default value)
215
+ * @param array|string|null $validation Validation rules
216
216
*
217
217
* @return string The user input
218
218
*
@@ -258,7 +258,7 @@ public static function prompt(string $field, $options = null, $validation = null
258
258
$ input = trim (static ::input ()) ?: $ default ;
259
259
260
260
if ($ validation ) {
261
- while (! static ::validate (trim ($ field ), $ input , $ validation )) {
261
+ while (! static ::validate (' " ' . trim ($ field ) . ' " ' , $ input , $ validation )) {
262
262
$ input = static ::prompt ($ field , $ options , $ validation );
263
263
}
264
264
}
@@ -448,7 +448,7 @@ public static function print(string $text = '', ?string $foreground = null, ?str
448
448
}
449
449
450
450
/**
451
- * Outputs a string to the cli on it's own line.
451
+ * Outputs a string to the cli on its own line.
452
452
*
453
453
* @return void
454
454
*/
@@ -574,10 +574,10 @@ public static function clearScreen()
574
574
* Returns the given text with the correct color codes for a foreground and
575
575
* optionally a background color.
576
576
*
577
- * @param string $text The text to color
578
- * @param string $foreground The foreground color
579
- * @param string $background The background color
580
- * @param string $format Other formatting to apply. Currently only 'underline' is understood
577
+ * @param string $text The text to color
578
+ * @param string $foreground The foreground color
579
+ * @param string|null $background The background color
580
+ * @param string|null $format Other formatting to apply. Currently only 'underline' is understood
581
581
*
582
582
* @return string The color coded string
583
583
*/
@@ -834,7 +834,7 @@ public static function showProgress($thisStep = 1, int $totalSteps = 10)
834
834
* width.
835
835
*
836
836
* If an int is passed into $pad_left, then all strings after the first
837
- * will padded with that many spaces to the left. Useful when printing
837
+ * will pad with that many spaces to the left. Useful when printing
838
838
* short descriptions that need to start on an existing line.
839
839
*/
840
840
public static function wrap (?string $ string = null , int $ max = 0 , int $ padLeft = 0 ): string
0 commit comments