@@ -90,7 +90,7 @@ private function askQuestions(array &$vars): void {
9090 if ($ ir ->confirm ('Needs component props? ' )) {
9191 $ vars ['component_props ' ] = [];
9292 do {
93- $ prop = $ this ->askProp ($ ir );
93+ $ prop = $ this ->askProp ($ vars , $ ir );
9494 $ vars ['component_props ' ][] = $ prop ;
9595 } while ($ ir ->confirm ('Add another prop? ' ));
9696 }
@@ -161,10 +161,13 @@ private function askLibrary(): ?string {
161161 /**
162162 * Asks for multiple questions to define a prop and its schema.
163163 *
164+ * @psalm-param array{component_machine_name: mixed, ...<array-key, mixed>} $vars
165+ * The answers to the CLI questions.
166+ *
164167 * @return array
165168 * The prop data, if any.
166169 */
167- protected function askProp (Interviewer $ ir ): array {
170+ protected function askProp (array $ vars , Interviewer $ ir ): array {
168171 $ prop = [];
169172 $ prop ['title ' ] = $ ir ->ask ('Prop title ' , '' , new Required ());
170173 $ default = Utils::human2machine ($ prop ['title ' ]);
@@ -180,7 +183,10 @@ protected function askProp(Interviewer $ir): array {
180183 ];
181184 $ prop ['type ' ] = $ ir ->choice ('Prop type ' , $ choices , 'String ' );
182185 if (!\in_array ($ prop ['type ' ], ['string ' , 'number ' , 'boolean ' ])) {
183- $ this ->io ()->warning ('Unable to generate full schema for ' . $ prop ['type ' ] . '. Please edit metadata.json after generation. ' );
186+ /** @psalm-var string $type */
187+ $ type = $ prop ['type ' ];
188+ $ component_schema_name = $ vars ['component_machine_name ' ] . '.component.yml ' ;
189+ $ this ->io ()->warning (\sprintf ('Unable to generate full schema for %s. Please edit %s after generation. ' , $ type , $ component_schema_name ));
184190 }
185191 return $ prop ;
186192 }
0 commit comments