3
3
namespace Drush \Style ;
4
4
5
5
use Drush \Drush ;
6
- use Illuminate \Support \Collection ;
7
6
use JetBrains \PhpStorm \Deprecated ;
8
7
use Laravel \Prompts \MultiSearchPrompt ;
9
8
use Laravel \Prompts \MultiSelectPrompt ;
@@ -76,40 +75,40 @@ public function password(\Stringable|string $label, \Stringable|string $placehol
76
75
/**
77
76
* Prompt the user to select an option.
78
77
*
79
- * @param array<int|string, string>|Collection<int|string, string> $options
78
+ * @param array<int|string, string> $options
80
79
* @param true|string $required
81
80
*/
82
- public function select (string $ label , array | Collection $ options , int |string |null $ default = null , int $ scroll = 10 , ?\Closure $ validate = null , string $ hint = '' , bool |string $ required = true ): int |string
81
+ public function select (string $ label , array $ options , int |string |null $ default = null , int $ scroll = 10 , ?\Closure $ validate = null , string $ hint = '' , bool |string $ required = true ): int |string
83
82
{
84
83
return (new SelectPrompt ($ label , $ options , $ default , $ scroll , $ validate , $ hint , $ required ))->prompt ();
85
84
}
86
85
87
86
/**
88
87
* Prompt the user to select multiple options.
89
88
*
90
- * @param array<int|string, string>|Collection<int|string, string> $options
91
- * @param array<int|string>|Collection<int, int|string> $default
89
+ * @param array<int|string, string> $options
90
+ * @param array<int|string> $default
92
91
* @return array<int|string>
93
92
*/
94
- public function multiselect (string $ label , array | Collection $ options , array | Collection $ default = [], int $ scroll = 10 , bool |string $ required = false , ?\Closure $ validate = null , string $ hint = 'Use the space bar to select options. ' ): array
93
+ public function multiselect (string $ label , array $ options , array $ default = [], int $ scroll = 10 , bool |string $ required = false , ?\Closure $ validate = null , string $ hint = 'Use the space bar to select options. ' ): array
95
94
{
96
95
return (new MultiSelectPrompt ($ label , $ options , $ default , $ scroll , $ required , $ validate , $ hint ))->prompt ();
97
96
}
98
97
99
98
/**
100
99
* Prompt the user for text input with auto-completion.
101
100
*
102
- * @param array<string>|Collection<int, string>| Closure(string): array<string> $options
101
+ * @param array<string>|\ Closure(string): array<string> $options
103
102
*/
104
- public function suggest (string $ label , array |Collection | \Closure $ options , string $ placeholder = '' , string $ default = '' , int $ scroll = 10 , bool |string $ required = false , ?\Closure $ validate = null , string $ hint = 'Start typing the first letter(s) and matching choices will be shown. ' ): string
103
+ public function suggest (string $ label , array |\Closure $ options , string $ placeholder = '' , string $ default = '' , int $ scroll = 10 , bool |string $ required = false , ?\Closure $ validate = null , string $ hint = 'Start typing the first letter(s) and matching choices will be shown. ' ): string
105
104
{
106
105
return (new SuggestPrompt ($ label , $ options , $ placeholder , $ default , $ scroll , $ required , $ validate , $ hint ))->prompt ();
107
106
}
108
107
109
108
/**
110
109
* Allow the user to search for an option.
111
110
*
112
- * @param Closure(string): array<int|string, string> $options
111
+ * @param \ Closure(string): array<int|string, string> $options
113
112
* @param true|string $required
114
113
*/
115
114
public function search (string $ label , \Closure $ options , string $ placeholder = '' , int $ scroll = 10 , ?\Closure $ validate = null , string $ hint = '' , bool |string $ required = true ): int |string
@@ -120,7 +119,7 @@ public function search(string $label, \Closure $options, string $placeholder = '
120
119
/**
121
120
* Allow the user to search for multiple option.
122
121
*
123
- * @param Closure(string): array<int|string, string> $options
122
+ * @param \ Closure(string): array<int|string, string> $options
124
123
* @return array<int|string>
125
124
*/
126
125
public function multisearch (string $ label , \Closure $ options , string $ placeholder = '' , int $ scroll = 10 , bool |string $ required = false , ?\Closure $ validate = null , string $ hint = 'Use the space bar to select options. ' ): array
@@ -148,7 +147,7 @@ public function spin(\Closure $callback, string $message = ''): mixed
148
147
* @template TReturn
149
148
*
150
149
* @param TSteps $steps
151
- * @param ?Closure((TSteps is int ? int : value-of<TSteps>), Progress<TSteps>): TReturn $callback
150
+ * @param ?\ Closure((TSteps is int ? int : value-of<TSteps>), Progress<TSteps>): TReturn $callback
152
151
* @return ($callback is null ? Progress<TSteps> : array<TReturn>)
153
152
*/
154
153
public function progress (string $ label , iterable |int $ steps , ?\Closure $ callback = null , string $ hint = '' ): array |Progress
0 commit comments