]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/ConfigType.php
Update to Symfony 2.7
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / ConfigType.php
index d5890971a976484793c13b033f24307fc1697b6a..49b05b807185f5af25525bddd81476b13bf42e38 100644 (file)
@@ -4,7 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type;
 
 use Symfony\Component\Form\AbstractType;
 use Symfony\Component\Form\FormBuilderInterface;
-use Symfony\Component\OptionsResolver\OptionsResolverInterface;
+use Symfony\Component\OptionsResolver\OptionsResolver;
 
 class ConfigType extends AbstractType
 {
@@ -24,14 +24,17 @@ class ConfigType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('theme', 'choice', array('choices' => $this->themes))
+            ->add('theme', 'choice', array(
+                'choices' => array_flip($this->themes),
+                'choices_as_values' => true,
+            ))
             ->add('items_per_page')
             ->add('language')
             ->add('save', 'submit')
         ;
     }
 
-    public function setDefaultOptions(OptionsResolverInterface $resolver)
+    public function configureOptions(OptionsResolver $resolver)
     {
         $resolver->setDefaults(array(
             'data_class' => 'Wallabag\CoreBundle\Entity\Config',