X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FConfigType.php;h=4cf22200fa753ba06ab113505fe5fa7e77a59d51;hb=41c9eecfa728df7d8734ca1b0a69c55c93aafcea;hp=b30b4706af4a750ae7548f413a5a4988b0392661;hpb=77b9db87b84e20a6042444e3b18665bc66d4f1f2;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index b30b4706..4cf22200 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -10,8 +10,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ConfigType extends AbstractType { - private $themes = array(); - private $languages = array(); + private $themes = []; + private $languages = []; /** * @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes) @@ -30,39 +30,39 @@ class ConfigType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('theme', ChoiceType::class, array( + ->add('theme', ChoiceType::class, [ 'choices' => array_flip($this->themes), 'choices_as_values' => true, 'label' => 'config.form_settings.theme_label', - )) - ->add('items_per_page', null, array( + ]) + ->add('items_per_page', null, [ 'label' => 'config.form_settings.items_per_page_label', - )) - ->add('reading_speed', ChoiceType::class, array( + ]) + ->add('reading_speed', ChoiceType::class, [ 'label' => 'config.form_settings.reading_speed.label', - 'choices' => array( + 'choices' => [ 'config.form_settings.reading_speed.100_word' => '0.5', 'config.form_settings.reading_speed.200_word' => '1', 'config.form_settings.reading_speed.300_word' => '1.5', 'config.form_settings.reading_speed.400_word' => '2', - ), - )) - ->add('language', ChoiceType::class, array( + ], + ]) + ->add('language', ChoiceType::class, [ 'choices' => array_flip($this->languages), 'choices_as_values' => true, 'label' => 'config.form_settings.language_label', - )) - ->add('save', SubmitType::class, array( + ]) + ->add('save', SubmitType::class, [ 'label' => 'config.form.save', - )) + ]) ; } public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults(array( + $resolver->setDefaults([ 'data_class' => 'Wallabag\CoreBundle\Entity\Config', - )); + ]); } public function getBlockPrefix()