6
6
use Illuminate \Console \Command ;
7
7
use Illuminate \Contracts \Console \PromptsForMissingInput ;
8
8
use Illuminate \Contracts \Filesystem \FileNotFoundException ;
9
+ use Symfony \Component \Console \Input \InputArgument ;
9
10
use Symfony \Component \Console \Input \InputInterface ;
10
11
use Symfony \Component \Console \Output \OutputInterface ;
11
12
use Tray2 \MakeSeeder \CsvParser ;
@@ -82,7 +83,7 @@ protected function loadModels(): array
82
83
return (new ModelFinder ())->find ();
83
84
}
84
85
85
- protected function showSelect (InputInterface $ input , $ argument , mixed $ label ): void
86
+ protected function showSelect (InputInterface $ input , InputArgument $ argument , mixed $ label ): void
86
87
{
87
88
$ options = $ this ->loadModels ();
88
89
$ input ->setArgument ($ argument ->getName (), select (
@@ -91,15 +92,15 @@ protected function showSelect(InputInterface $input, $argument, mixed $label): v
91
92
));
92
93
}
93
94
94
- protected function showTextInput (InputInterface $ input , $ argument , mixed $ label ): void
95
+ protected function showTextInput (InputInterface $ input , InputArgument $ argument , mixed $ label ): void
95
96
{
96
97
$ input ->setArgument ($ argument ->getName (), text (
97
98
label: $ label ,
98
99
validate: fn ($ value ) => empty ($ value ) ? "The {$ argument ->getName ()} is required. " : null ,
99
100
));
100
101
}
101
102
102
- protected function getLabel ($ argument ): mixed
103
+ protected function getLabel (InputArgument $ argument ): mixed
103
104
{
104
105
return $ this ->promptForMissingArgumentsUsing ()[$ argument ->getName ()] ??
105
106
'What is ' . lcfirst ($ argument ->getDescription () ?: ('the ' . $ argument ->getName ())) . '? ' ;
@@ -114,7 +115,8 @@ protected function promptForMissingArguments(InputInterface $input, OutputInterf
114
115
$ label = $ this ->getLabel ($ argument );
115
116
116
117
if ($ label instanceof Closure) {
117
- return $ input ->setArgument ($ argument ->getName (), $ label ());
118
+ $ input ->setArgument ($ argument ->getName (), $ label ());
119
+ return ;
118
120
}
119
121
120
122
if (is_array ($ label )) {
0 commit comments