@@ -78,23 +78,23 @@ public function submit(): array
7878 /**
7979 * Prompt the user for text input.
8080 */
81- public function text (string $ label , string $ placeholder = '' , string $ default = '' , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null ): self
81+ public function text (string $ label , string $ placeholder = '' , string $ default = '' , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null , ? Closure $ transform = null ): self
8282 {
8383 return $ this ->runPrompt (text (...), get_defined_vars ());
8484 }
8585
8686 /**
8787 * Prompt the user for multiline text input.
8888 */
89- public function textarea (string $ label , string $ placeholder = '' , string $ default = '' , bool |string $ required = false , ?Closure $ validate = null , string $ hint = '' , int $ rows = 5 , ?string $ name = null ): self
89+ public function textarea (string $ label , string $ placeholder = '' , string $ default = '' , bool |string $ required = false , ?Closure $ validate = null , string $ hint = '' , int $ rows = 5 , ?string $ name = null , ? Closure $ transform = null ): self
9090 {
9191 return $ this ->runPrompt (textarea (...), get_defined_vars ());
9292 }
9393
9494 /**
9595 * Prompt the user for input, hiding the value.
9696 */
97- public function password (string $ label , string $ placeholder = '' , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null ): self
97+ public function password (string $ label , string $ placeholder = '' , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null , ? Closure $ transform = null ): self
9898 {
9999 return $ this ->runPrompt (password (...), get_defined_vars ());
100100 }
@@ -105,7 +105,7 @@ public function password(string $label, string $placeholder = '', bool|string $r
105105 * @param array<int|string, string>|Collection<int|string, string> $options
106106 * @param true|string $required
107107 */
108- public function select (string $ label , array |Collection $ options , int |string |null $ default = null , int $ scroll = 5 , mixed $ validate = null , string $ hint = '' , bool |string $ required = true , ?string $ name = null ): self
108+ public function select (string $ label , array |Collection $ options , int |string |null $ default = null , int $ scroll = 5 , mixed $ validate = null , string $ hint = '' , bool |string $ required = true , ?string $ name = null , ? Closure $ transform = null ): self
109109 {
110110 return $ this ->runPrompt (select (...), get_defined_vars ());
111111 }
@@ -116,15 +116,15 @@ public function select(string $label, array|Collection $options, int|string|null
116116 * @param array<int|string, string>|Collection<int|string, string> $options
117117 * @param array<int|string>|Collection<int, int|string> $default
118118 */
119- public function multiselect (string $ label , array |Collection $ options , array |Collection $ default = [], int $ scroll = 5 , bool |string $ required = false , mixed $ validate = null , string $ hint = 'Use the space bar to select options. ' , ?string $ name = null ): self
119+ public function multiselect (string $ label , array |Collection $ options , array |Collection $ default = [], int $ scroll = 5 , bool |string $ required = false , mixed $ validate = null , string $ hint = 'Use the space bar to select options. ' , ?string $ name = null , ? Closure $ transform = null ): self
120120 {
121121 return $ this ->runPrompt (multiselect (...), get_defined_vars ());
122122 }
123123
124124 /**
125125 * Prompt the user to confirm an action.
126126 */
127- public function confirm (string $ label , bool $ default = true , string $ yes = 'Yes ' , string $ no = 'No ' , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null ): self
127+ public function confirm (string $ label , bool $ default = true , string $ yes = 'Yes ' , string $ no = 'No ' , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null , ? Closure $ transform = null ): self
128128 {
129129 return $ this ->runPrompt (confirm (...), get_defined_vars ());
130130 }
@@ -142,7 +142,7 @@ public function pause(string $message = 'Press enter to continue...', ?string $n
142142 *
143143 * @param array<string>|Collection<int, string>|Closure(string): array<string> $options
144144 */
145- public function suggest (string $ label , array |Collection |Closure $ options , string $ placeholder = '' , string $ default = '' , int $ scroll = 5 , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null ): self
145+ public function suggest (string $ label , array |Collection |Closure $ options , string $ placeholder = '' , string $ default = '' , int $ scroll = 5 , bool |string $ required = false , mixed $ validate = null , string $ hint = '' , ?string $ name = null , ? Closure $ transform = null ): self
146146 {
147147 return $ this ->runPrompt (suggest (...), get_defined_vars ());
148148 }
@@ -153,7 +153,7 @@ public function suggest(string $label, array|Collection|Closure $options, string
153153 * @param Closure(string): array<int|string, string> $options
154154 * @param true|string $required
155155 */
156- public function search (string $ label , Closure $ options , string $ placeholder = '' , int $ scroll = 5 , mixed $ validate = null , string $ hint = '' , bool |string $ required = true , ?string $ name = null ): self
156+ public function search (string $ label , Closure $ options , string $ placeholder = '' , int $ scroll = 5 , mixed $ validate = null , string $ hint = '' , bool |string $ required = true , ?string $ name = null , ? Closure $ transform = null ): self
157157 {
158158 return $ this ->runPrompt (search (...), get_defined_vars ());
159159 }
@@ -163,7 +163,7 @@ public function search(string $label, Closure $options, string $placeholder = ''
163163 *
164164 * @param Closure(string): array<int|string, string> $options
165165 */
166- public function multisearch (string $ label , Closure $ options , string $ placeholder = '' , int $ scroll = 5 , bool |string $ required = false , mixed $ validate = null , string $ hint = 'Use the space bar to select options. ' , ?string $ name = null ): self
166+ public function multisearch (string $ label , Closure $ options , string $ placeholder = '' , int $ scroll = 5 , bool |string $ required = false , mixed $ validate = null , string $ hint = 'Use the space bar to select options. ' , ?string $ name = null , ? Closure $ transform = null ): self
167167 {
168168 return $ this ->runPrompt (multisearch (...), get_defined_vars ());
169169 }
0 commit comments