Lines
100.00%
23 / 23
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| buildForm | 100.00% | 20 / 20 | 100.00% | 1 / 1 | 1 | ||
| configureOptions | 100.00% | 3 / 3 | 100.00% | 1 / 1 | 1 | ||
| 17 | class TimelineEventType extends AbstractType | |
| 18 | { | |
| 19 | public function buildForm(FormBuilderInterface $builder, array $options): void | |
| 20 | { | |
| 21 | $builder | |
| 22 | ->add('date', DateType::class, [ | |
| 23 | 'label' => 'timeline.event.date', | |
| 24 | 'widget' => 'single_text', | |
| 25 | 'input' => 'datetime_immutable', | |
| 26 | ]) | |
| 27 | ->add('endDate', DateType::class, [ | |
| 28 | 'label' => 'timeline.event.end_date', | |
| 29 | 'help' => 'timeline.event.end_date_help', | |
| 30 | 'widget' => 'single_text', | |
| 31 | 'input' => 'datetime_immutable', | |
| 32 | 'required' => false, | |
| 33 | ]) | |
| 34 | ->add('text', TextareaType::class, [ | |
| 35 | 'label' => 'timeline.event.text', | |
| 36 | // Blank is null otherwise, the entity's text is a string | |
| 37 | 'empty_data' => '', | |
| 38 | 'help' => 'timeline.event.text_help', | |
| 39 | 'attr' => ['maxlength' => 500, 'rows' => 2], | |
| 40 | ]) | |
| 41 | ; | |
| 42 | } | |
| 43 | ||
| 44 | public function configureOptions(OptionsResolver $resolver): void | |
| 45 | { | |
| 46 | $resolver->setDefaults([ | |
| 47 | 'data_class' => TimelineEvent::class, | |
| 48 | ]); | |
| 49 | } | |
| 50 | } |