@@ -535,6 +535,10 @@ protected function askQuestionForProperty($property_info, $default) {
535
535
}
536
536
537
537
if ($ property_info ['format ' ] == 'array ' ) {
538
+ if (!is_array ($ default )) {
539
+ $ default = [$ default ];
540
+ }
541
+
538
542
// Multi-valued property.
539
543
// TODO: consider adding the explanation message on its own line first --
540
544
// but need to work out how to format it, in the face of nonexistent
@@ -544,7 +548,8 @@ protected function askQuestionForProperty($property_info, $default) {
544
548
$ question = new \Symfony \Component \Console \Question \ChoiceQuestion (
545
549
$ this ->getQuestionPromptForProperty ("Enter the @label, one per line, empty line to finish " , $ property_info ),
546
550
$ options ,
547
- $ default
551
+ // Feed the default values one by one.
552
+ array_shift ($ default )
548
553
);
549
554
$ question ->setAutocompleterValues ($ autocomplete_options );
550
555
// Hack to work around the question not allowing an empty answer.
@@ -576,7 +581,7 @@ protected function askQuestionForProperty($property_info, $default) {
576
581
// For subsequent iterations, the question should not show options.
577
582
$ question = new \Symfony \Component \Console \Question \Question (
578
583
$ this ->getQuestionPromptForProperty ("Enter further @label, one per line, empty line to finish " , $ property_info ),
579
- $ default
584
+ array_shift ( $ default)
580
585
);
581
586
$ question ->setAutocompleterValues ($ autocomplete_options );
582
587
// Hack to work around the question not allowing an empty answer.
0 commit comments