@@ -114,14 +114,14 @@ public function runPrompts(): void {
114114 // phpcs:disable Drupal.WhiteSpace.ScopeIndent.IncorrectExact
115115 $ responses = form ()
116116 ->intro ('General information ' )
117- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Name::class, $ n )), Name::id ())
118- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (MachineName::class, $ n , NULL , $ r )), MachineName::id ())
119- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Org::class, $ n , NULL , $ r )), Org::id ())
120- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (OrgMachineName::class, $ n , NULL , $ r )), OrgMachineName::id ())
121- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Domain::class, $ n , NULL , $ r )), Domain::id ())
117+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Name::class)), Name::id ())
118+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (MachineName::class, NULL , $ r )), MachineName::id ())
119+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Org::class, NULL , $ r )), Org::id ())
120+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (OrgMachineName::class, NULL , $ r )), OrgMachineName::id ())
121+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Domain::class, NULL , $ r )), Domain::id ())
122122
123123 ->intro ('Code repository ' )
124- ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (CodeProvider::class, $ n )), CodeProvider::id ())
124+ ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (CodeProvider::class)), CodeProvider::id ())
125125 ->addIf (
126126 fn ($ r ): bool => $ this ->handlers [GithubToken::id ()]->shouldRun ($ r ),
127127 fn ($ r , $ pr , $ n ) => Tui::note ('<info> ' . GithubToken::description ($ r ) . '</info> ' )
@@ -136,35 +136,35 @@ function ($r, $pr, $n): string {
136136 return is_string ($ resolved_value ) ? $ resolved_value : '' ;
137137 }
138138 else {
139- return password (...$ this ->args (GithubToken::class, $ n ));
139+ return password (...$ this ->args (GithubToken::class));
140140 }
141141 },
142142 GithubToken::id ()
143143 )
144144 ->addIf (
145145 fn ($ r ): bool => $ this ->handlers [GithubRepo::id ()]->shouldRun ($ r ),
146- fn ($ r , $ pr , $ n ): string => text (...$ this ->args (GithubRepo::class, $ n , NULL , $ r )),
146+ fn ($ r , $ pr , $ n ): string => text (...$ this ->args (GithubRepo::class, NULL , $ r )),
147147 GithubRepo::id ()
148148 )
149149
150150 ->intro ('Drupal ' )
151151 ->add (
152- fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (Profile::class, $ n )),
152+ fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (Profile::class)),
153153 Profile::id ()
154154 )
155155 ->addIf (
156156 fn ($ r ): bool => $ this ->handlers [ProfileCustom::id ()]->shouldRun ($ r ),
157- fn ($ r , $ pr , $ n ): string => text (...$ this ->args (ProfileCustom::class, $ n )),
157+ fn ($ r , $ pr , $ n ): string => text (...$ this ->args (ProfileCustom::class)),
158158 ProfileCustom::id ()
159159 )
160- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (ModulePrefix::class, $ n , NULL , $ r )), ModulePrefix::id ())
161- ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Theme::class, $ n , NULL , $ r )), Theme::id ())
160+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (ModulePrefix::class, NULL , $ r )), ModulePrefix::id ())
161+ ->add (fn ($ r , $ pr , $ n ): string => text (...$ this ->args (Theme::class, NULL , $ r )), Theme::id ())
162162
163163 ->intro ('Services ' )
164- ->add (fn ($ r , $ pr , $ n ): array => multiselect (...$ this ->args (Services::class, $ n )), Services::id ())
164+ ->add (fn ($ r , $ pr , $ n ): array => multiselect (...$ this ->args (Services::class)), Services::id ())
165165
166166 ->intro ('Hosting ' )
167- ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (HostingProvider::class, $ n )), HostingProvider::id ())
167+ ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (HostingProvider::class)), HostingProvider::id ())
168168 ->add (
169169 function (array $ r , $ pr , $ n ): string {
170170 $ handler = $ this ->handlers [Webroot::id ()];
@@ -178,48 +178,48 @@ function (array $r, $pr, $n): string {
178178 };
179179 }
180180 else {
181- return text (...$ this ->args (Webroot::class, $ n , NULL , $ r ));
181+ return text (...$ this ->args (Webroot::class, NULL , $ r ));
182182 }
183183 },
184184 Webroot::id ()
185185 )
186186
187187 ->intro ('Deployment ' )
188- ->add (fn ($ r , $ pr , $ n ): array => multiselect (...$ this ->args (DeployType::class, $ n , NULL , $ r )), DeployType::id ())
188+ ->add (fn ($ r , $ pr , $ n ): array => multiselect (...$ this ->args (DeployType::class, NULL , $ r )), DeployType::id ())
189189
190190 ->intro ('Workflow ' )
191191 ->add (fn ($ r , $ pr , $ n ) => Tui::note ('<info>Provisioning</info> is the process of setting up the site in the environment with an already assembled codebase. ' ))
192- ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (ProvisionType::class, $ n )), ProvisionType::id ())
192+ ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (ProvisionType::class)), ProvisionType::id ())
193193 ->addIf (
194194 fn ($ r ): bool => $ this ->handlers [DatabaseDownloadSource::id ()]->shouldRun ($ r ),
195- fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (DatabaseDownloadSource::class, $ n , NULL , $ r )),
195+ fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (DatabaseDownloadSource::class, NULL , $ r )),
196196 DatabaseDownloadSource::id ()
197197 )
198198 ->addIf (
199199 fn ($ r ): bool => $ this ->handlers [DatabaseImage::id ()]->shouldRun ($ r ),
200200 function ($ r , $ pr , $ n ): string {
201201 $ handler = $ this ->handlers [DatabaseImage::id ()];
202- $ args = $ this ->args (DatabaseImage::class, $ n , NULL , $ r );
202+ $ args = $ this ->args (DatabaseImage::class, NULL , $ r );
203203 $ args ['placeholder ' ] = $ handler ->placeholder ($ r );
204204 return text (...$ args );
205205 },
206206 DatabaseImage::id ()
207207 )
208208
209209 ->intro ('Continuous Integration ' )
210- ->add (fn (array $ r , $ pr , $ n ): int |string => select (...$ this ->args (CiProvider::class, $ n , NULL , $ r )), CiProvider::id ())
210+ ->add (fn (array $ r , $ pr , $ n ): int |string => select (...$ this ->args (CiProvider::class, NULL , $ r )), CiProvider::id ())
211211
212212 ->intro ('Automations ' )
213- ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (DependencyUpdatesProvider::class, $ n )), DependencyUpdatesProvider::id ())
214- ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (AssignAuthorPr::class, $ n )), AssignAuthorPr::id ())
215- ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (LabelMergeConflictsPr::class, $ n )), LabelMergeConflictsPr::id ())
213+ ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (DependencyUpdatesProvider::class)), DependencyUpdatesProvider::id ())
214+ ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (AssignAuthorPr::class)), AssignAuthorPr::id ())
215+ ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (LabelMergeConflictsPr::class)), LabelMergeConflictsPr::id ())
216216
217217 ->intro ('Documentation ' )
218- ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (PreserveDocsProject::class, $ n )), PreserveDocsProject::id ())
219- ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (PreserveDocsOnboarding::class, $ n )), PreserveDocsOnboarding::id ())
218+ ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (PreserveDocsProject::class)), PreserveDocsProject::id ())
219+ ->add (fn ($ r , $ pr , $ n ): bool => confirm (...$ this ->args (PreserveDocsOnboarding::class)), PreserveDocsOnboarding::id ())
220220
221221 ->intro ('AI ' )
222- ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (AiCodeInstructions::class, $ n )), AiCodeInstructions::id ())
222+ ->add (fn ($ r , $ pr , $ n ): int |string => select (...$ this ->args (AiCodeInstructions::class)), AiCodeInstructions::id ())
223223
224224 ->submit ();
225225
@@ -495,7 +495,6 @@ protected function initHandlers(): void {
495495 *
496496 * @param string $handler_class
497497 * The handler class name.
498- * @param string $id
499498 * The handler id.
500499 * @param mixed $default_override
501500 * Optional override for the default value (for response dependencies).
@@ -505,7 +504,7 @@ protected function initHandlers(): void {
505504 * @return array
506505 * Array of prompt arguments suitable for Laravel prompts.
507506 */
508- private function args (string $ handler_class , string $ id , mixed $ default_override = NULL , array $ responses = []): array {
507+ private function args (string $ handler_class , mixed $ default_override = NULL , array $ responses = []): array {
509508 $ id = $ handler_class ::id ();
510509
511510 if (!array_key_exists ($ id , $ this ->handlers )) {
0 commit comments