File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,36 +166,6 @@ public function configureOptions(OptionsResolver $resolver): void
166166
167167 return $ data ;
168168 });
169-
170- $ resolver ->setNormalizer ('help ' , function (Options $ options , $ value ) {
171- if (null === $ value ) {
172- $ dotFields = ['year ' , 'month ' , 'day ' ];
173- $ colonFields = ['hour ' , 'minute ' , 'second ' ];
174-
175- $ dotFields = array_values (array_filter ($ dotFields , static fn ($ field ) => isset ($ options [$ field ]) && $ options [$ field ]));
176- $ colonFields = array_values (array_filter ($ colonFields , static fn ($ field ) => isset ($ options [$ field ]) && $ options [$ field ]));
177-
178- $ value = '' ;
179-
180- for ($ index = 0 , $ lastIndex = \count ($ dotFields ); $ index < $ lastIndex ; ++$ index ) {
181- if ($ index === $ lastIndex - 1 && 0 === \count ($ colonFields )) {
182- $ value .= \sprintf ('%ss ' , $ dotFields [$ index ]);
183- } else {
184- $ value .= \sprintf ('%ss. ' , $ dotFields [$ index ]);
185- }
186- }
187-
188- for ($ index = 0 , $ lastIndex = \count ($ colonFields ); $ index < $ lastIndex ; ++$ index ) {
189- if ($ index === $ lastIndex - 1 ) {
190- $ value .= \sprintf ('%ss ' , $ colonFields [$ index ]);
191- } else {
192- $ value .= \sprintf ('%ss: ' , $ colonFields [$ index ]);
193- }
194- }
195- }
196-
197- return $ value ;
198- });
199169 }
200170
201171 public function getBlockPrefix (): string
Original file line number Diff line number Diff line change 1515 <div class =" input-group" >
1616 {% if units .year %}
1717 {{ form_widget(form .year ) }}
18+ <span class =" input-group-text" >{{ ' years' }}</span >
1819 {% endif %}
1920
2021 {% if units .month %}
2324 {% endif %}
2425
2526 {{ form_widget(form .month ) }}
27+ <span class =" input-group-text" >{{ ' months' }}</span >
2628 {% endif %}
2729
2830 {% if units .day %}
3133 {% endif %}
3234
3335 {{ form_widget(form .day ) }}
36+ <span class =" input-group-text" >{{ ' days' }}</span >
3437 {% endif %}
3538
3639 {% if units .hour %}
3942 {% endif %}
4043
4144 {{ form_widget(form .hour ) }}
45+ <span class =" input-group-text" >{{ ' hours' }}</span >
4246 {% endif %}
4347
4448 {% if units .minute %}
4751 {% endif %}
4852
4953 {{ form_widget(form .minute ) }}
54+ <span class =" input-group-text" >{{ ' minutes' }}</span >
5055 {% endif %}
5156
5257 {% if units .second %}
5560 {% endif %}
5661
5762 {{ form_widget(form .second ) }}
63+ <span class =" input-group-text" >{{ ' seconds' }}</span >
5864 {% endif %}
5965 </div >
6066 </div >
Original file line number Diff line number Diff line change 99 <div {{ block (' widget_container_attributes' ) }}>
1010 {% if units .year %}
1111 {{ form_widget(form .year ) }}
12+ <span class =" input-group-text" >{{ ' years' }}</span >
1213 {% endif %}
1314
1415 {% if units .month %}
1718 {% endif %}
1819
1920 {{ form_widget(form .month ) }}
21+ <span class =" input-group-text" >{{ ' months' }}</span >
2022 {% endif %}
2123
2224 {% if units .day %}
2527 {% endif %}
2628
2729 {{ form_widget(form .day ) }}
30+ <span class =" input-group-text" >{{ ' days' }}</span >
2831 {% endif %}
2932
3033 {% if units .hour %}
3336 {% endif %}
3437
3538 {{ form_widget(form .hour ) }}
39+ <span class =" input-group-text" >{{ ' hours' }}</span >
3640 {% endif %}
3741
3842 {% if units .minute %}
4145 {% endif %}
4246
4347 {{ form_widget(form .minute ) }}
48+ <span class =" input-group-text" >{{ ' minutes' }}</span >
4449 {% endif %}
4550
4651 {% if units .second %}
4954 {% endif %}
5055
5156 {{ form_widget(form .second ) }}
57+ <span class =" input-group-text" >{{ ' seconds' }}</span >
5258 {% endif %}
5359 </div >
5460{%- endblock -%}
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ public function testConfigureAnotherUnit(): void
4747
4848 $ this ->assertTrue ($ form ->isSynchronized ());
4949 $ this ->assertEquals (new Second ("5196852 " ), $ form ->getData ()->getValue ());
50- $ this ->assertSame ("months.hours:minutes:seconds " , $ view ->vars ['help ' ]);
5150 }
5251
5352 public function testSubmitNull (): void
@@ -81,8 +80,6 @@ public function testWithPreData(): void
8180 'minute ' => '12 ' ,
8281 'second ' => null ,
8382 ], $ view ->vars ['value ' ]);
84-
85- $ this ->assertSame ("hours:minutes " , $ view ->vars ['help ' ]);
8683 }
8784
8885 public function testWithNullPreData (): void
@@ -95,6 +92,5 @@ public function testWithNullPreData(): void
9592
9693 // Assert
9794 $ this ->assertNull ($ view ->vars ['value ' ]);
98- $ this ->assertSame ("hours:minutes " , $ view ->vars ['help ' ]);
9995 }
10096}
You can’t perform that action at this time.
0 commit comments