@@ -69,7 +69,7 @@ public function interactWith(
69
69
};
70
70
71
71
foreach ((array ) $ form ->getData () as $ key => $ entryData ) {
72
- $ this ->printEntryHeader ($ key , $ output );
72
+ $ this ->printEditEntryHeader ($ key , $ output );
73
73
$ prototype ->setData ($ entryData );
74
74
75
75
$ submittedEntry = $ this ->formInteractor ->interactWith ($ prototype , $ helperSet , $ input , $ output );
@@ -79,7 +79,9 @@ public function interactWith(
79
79
}
80
80
81
81
if ($ form ->getConfig ()->getOption ('allow_add ' )) {
82
+ $ key = count ($ submittedData ) - 1 ;
82
83
while ($ this ->askIfContinueToAdd ($ helperSet , $ input , $ output )) {
84
+ $ this ->printAddEntryHeader (++$ key , $ output );
83
85
$ submittedData [] = $ this ->formInteractor ->interactWith ($ prototype , $ helperSet , $ input , $ output );
84
86
}
85
87
}
@@ -139,7 +141,7 @@ private function printHeader(FormInterface $form, OutputInterface $output)
139
141
* @param int $entryNumber
140
142
* @param OutputInterface $output
141
143
*/
142
- private function printEntryHeader ($ entryNumber , OutputInterface $ output )
144
+ private function printEditEntryHeader ($ entryNumber , OutputInterface $ output )
143
145
{
144
146
$ output ->writeln (
145
147
strtr (
@@ -151,6 +153,22 @@ private function printEntryHeader($entryNumber, OutputInterface $output)
151
153
);
152
154
}
153
155
156
+ /**
157
+ * @param int $entryNumber
158
+ * @param OutputInterface $output
159
+ */
160
+ private function printAddEntryHeader ($ entryNumber , OutputInterface $ output )
161
+ {
162
+ $ output ->writeln (
163
+ strtr (
164
+ '<fieldset>Add entry {entryNumber}</fieldset> ' ,
165
+ [
166
+ '{entryNumber} ' => $ entryNumber ,
167
+ ]
168
+ )
169
+ );
170
+ }
171
+
154
172
/**
155
173
* @param HelperSet $helperSet
156
174
* @param InputInterface $input
0 commit comments