aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-12-22 10:16:34 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-15 09:35:38 +0100
commit619cc45359ead519b64129181a07e14160fbbfcb (patch)
tree328691553a67be72a1156ff976036ed0ac7b85bb /src/Wallabag/CoreBundle/Form
parent516022d60ea5c4e0c18a222590d23190a2c7765f (diff)
downloadwallabag-619cc45359ead519b64129181a07e14160fbbfcb.tar.gz
wallabag-619cc45359ead519b64129181a07e14160fbbfcb.tar.zst
wallabag-619cc45359ead519b64129181a07e14160fbbfcb.zip
Symfony Upgrade Fixer FTW
symfony-upgrade-fixer fix src/Wallabag/
Diffstat (limited to 'src/Wallabag/CoreBundle/Form')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php11
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ConfigType.php10
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EditEntryType.php11
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewEntryType.php8
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewTagType.php8
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewUserType.php14
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/RssType.php5
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php8
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/UserInformationType.php14
9 files changed, 56 insertions, 33 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
index 82e1954d..615b8169 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
@@ -3,6 +3,9 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\PasswordType;
7use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
8use Symfony\Component\Form\Extension\Core\Type\SubmitType;
6use Symfony\Component\Form\FormBuilderInterface; 9use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; 10use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
8use Symfony\Component\Validator\Constraints; 11use Symfony\Component\Validator\Constraints;
@@ -12,10 +15,10 @@ class ChangePasswordType extends AbstractType
12 public function buildForm(FormBuilderInterface $builder, array $options) 15 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 16 {
14 $builder 17 $builder
15 ->add('old_password', 'password', array( 18 ->add('old_password', PasswordType::class, array(
16 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), 19 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
17 )) 20 ))
18 ->add('new_password', 'repeated', array( 21 ->add('new_password', RepeatedType::class, array(
19 'type' => 'password', 22 'type' => 'password',
20 'invalid_message' => 'The password fields must match.', 23 'invalid_message' => 'The password fields must match.',
21 'required' => true, 24 'required' => true,
@@ -29,11 +32,11 @@ class ChangePasswordType extends AbstractType
29 new Constraints\NotBlank(), 32 new Constraints\NotBlank(),
30 ), 33 ),
31 )) 34 ))
32 ->add('save', 'submit') 35 ->add('save', SubmitType::class)
33 ; 36 ;
34 } 37 }
35 38
36 public function getName() 39 public function getBlockPrefix()
37 { 40 {
38 return 'change_passwd'; 41 return 'change_passwd';
39 } 42 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
index 1f0ad89d..88082a04 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8 10
@@ -28,15 +30,15 @@ class ConfigType extends AbstractType
28 public function buildForm(FormBuilderInterface $builder, array $options) 30 public function buildForm(FormBuilderInterface $builder, array $options)
29 { 31 {
30 $builder 32 $builder
31 ->add('theme', 'choice', array( 33 ->add('theme', ChoiceType::class, array(
32 'choices' => array_flip($this->themes), 34 'choices' => array_flip($this->themes),
33 'choices_as_values' => true, 35 'choices_as_values' => true,
34 )) 36 ))
35 ->add('items_per_page') 37 ->add('items_per_page')
36 ->add('language', 'choice', array( 38 ->add('language', ChoiceType::class, array(
37 'choices' => $this->languages, 39 'choices' => $this->languages,
38 )) 40 ))
39 ->add('save', 'submit') 41 ->add('save', SubmitType::class)
40 ; 42 ;
41 } 43 }
42 44
@@ -47,7 +49,7 @@ class ConfigType extends AbstractType
47 )); 49 ));
48 } 50 }
49 51
50 public function getName() 52 public function getBlockPrefix()
51 { 53 {
52 return 'config'; 54 return 'config';
53 } 55 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
index 0fa4b71f..0cb29881 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
@@ -3,6 +3,9 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 9use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 10use Symfony\Component\OptionsResolver\OptionsResolver;
8 11
@@ -11,14 +14,14 @@ class EditEntryType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 14 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 15 {
13 $builder 16 $builder
14 ->add('title', 'text', array('required' => true)) 17 ->add('title', TextType::class, array('required' => true))
15 ->add('is_public', 'checkbox', array('required' => false)) 18 ->add('is_public', CheckboxType::class, array('required' => false))
16 // @todo: add autocomplete 19 // @todo: add autocomplete
17 // ->add('tags', 'entity', array( 20 // ->add('tags', 'entity', array(
18 // 'class' => 'Wallabag\CoreBundle\Entity\Tag', 21 // 'class' => 'Wallabag\CoreBundle\Entity\Tag',
19 // 'choice_translation_domain' => true, 22 // 'choice_translation_domain' => true,
20 // )) 23 // ))
21 ->add('save', 'submit') 24 ->add('save', SubmitType::class)
22 ; 25 ;
23 } 26 }
24 27
@@ -29,7 +32,7 @@ class EditEntryType extends AbstractType
29 )); 32 ));
30 } 33 }
31 34
32 public function getName() 35 public function getBlockPrefix()
33 { 36 {
34 return 'entry'; 37 return 'entry';
35 } 38 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
index cb96d11a..fbce13f1 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\UrlType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8 10
@@ -11,8 +13,8 @@ class NewEntryType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 13 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 14 {
13 $builder 15 $builder
14 ->add('url', 'url', array('required' => true)) 16 ->add('url', UrlType::class, array('required' => true))
15 ->add('save', 'submit') 17 ->add('save', SubmitType::class)
16 ; 18 ;
17 } 19 }
18 20
@@ -23,7 +25,7 @@ class NewEntryType extends AbstractType
23 )); 25 ));
24 } 26 }
25 27
26 public function getName() 28 public function getBlockPrefix()
27 { 29 {
28 return 'entry'; 30 return 'entry';
29 } 31 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
index 8e4ab649..0f559031 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8 10
@@ -11,8 +13,8 @@ class NewTagType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 13 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 14 {
13 $builder 15 $builder
14 ->add('label', 'text', array('required' => true)) 16 ->add('label', TextType::class, array('required' => true))
15 ->add('save', 'submit') 17 ->add('save', SubmitType::class)
16 ; 18 ;
17 } 19 }
18 20
@@ -23,7 +25,7 @@ class NewTagType extends AbstractType
23 )); 25 ));
24 } 26 }
25 27
26 public function getName() 28 public function getBlockPrefix()
27 { 29 {
28 return 'tag'; 30 return 'tag';
29 } 31 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
index 8aabc8bb..e6fff976 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
@@ -3,6 +3,10 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\EmailType;
7use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
8use Symfony\Component\Form\Extension\Core\Type\SubmitType;
9use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 10use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 11use Symfony\Component\OptionsResolver\OptionsResolver;
8use Symfony\Component\Validator\Constraints; 12use Symfony\Component\Validator\Constraints;
@@ -12,8 +16,8 @@ class NewUserType extends AbstractType
12 public function buildForm(FormBuilderInterface $builder, array $options) 16 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 17 {
14 $builder 18 $builder
15 ->add('username', 'text', array('required' => true)) 19 ->add('username', TextType::class, array('required' => true))
16 ->add('plainPassword', 'repeated', array( 20 ->add('plainPassword', RepeatedType::class, array(
17 'type' => 'password', 21 'type' => 'password',
18 'constraints' => array( 22 'constraints' => array(
19 new Constraints\Length(array( 23 new Constraints\Length(array(
@@ -23,8 +27,8 @@ class NewUserType extends AbstractType
23 new Constraints\NotBlank(), 27 new Constraints\NotBlank(),
24 ), 28 ),
25 )) 29 ))
26 ->add('email', 'email') 30 ->add('email', EmailType::class)
27 ->add('save', 'submit') 31 ->add('save', SubmitType::class)
28 ; 32 ;
29 } 33 }
30 34
@@ -35,7 +39,7 @@ class NewUserType extends AbstractType
35 )); 39 ));
36 } 40 }
37 41
38 public function getName() 42 public function getBlockPrefix()
39 { 43 {
40 return 'new_user'; 44 return 'new_user';
41 } 45 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/RssType.php b/src/Wallabag/CoreBundle/Form/Type/RssType.php
index 1f7f4c68..def8782c 100644
--- a/src/Wallabag/CoreBundle/Form/Type/RssType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/RssType.php
@@ -3,6 +3,7 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
6use Symfony\Component\Form\FormBuilderInterface; 7use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 8use Symfony\Component\OptionsResolver\OptionsResolver;
8 9
@@ -12,7 +13,7 @@ class RssType extends AbstractType
12 { 13 {
13 $builder 14 $builder
14 ->add('rss_limit') 15 ->add('rss_limit')
15 ->add('save', 'submit') 16 ->add('save', SubmitType::class)
16 ; 17 ;
17 } 18 }
18 19
@@ -23,7 +24,7 @@ class RssType extends AbstractType
23 )); 24 ));
24 } 25 }
25 26
26 public function getName() 27 public function getBlockPrefix()
27 { 28 {
28 return 'rss_config'; 29 return 'rss_config';
29 } 30 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
index 428d94b3..296cec9e 100644
--- a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer; 10use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer;
@@ -12,8 +14,8 @@ class TaggingRuleType extends AbstractType
12 public function buildForm(FormBuilderInterface $builder, array $options) 14 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 15 {
14 $builder 16 $builder
15 ->add('rule', 'text', array('required' => true)) 17 ->add('rule', TextType::class, array('required' => true))
16 ->add('save', 'submit') 18 ->add('save', SubmitType::class)
17 ; 19 ;
18 20
19 $tagsField = $builder 21 $tagsField = $builder
@@ -30,7 +32,7 @@ class TaggingRuleType extends AbstractType
30 )); 32 ));
31 } 33 }
32 34
33 public function getName() 35 public function getBlockPrefix()
34 { 36 {
35 return 'tagging_rule'; 37 return 'tagging_rule';
36 } 38 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
index e06c937d..f52e409a 100644
--- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
@@ -3,6 +3,10 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7use Symfony\Component\Form\Extension\Core\Type\EmailType;
8use Symfony\Component\Form\Extension\Core\Type\SubmitType;
9use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 10use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 11use Symfony\Component\OptionsResolver\OptionsResolver;
8 12
@@ -11,10 +15,10 @@ class UserInformationType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 15 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 16 {
13 $builder 17 $builder
14 ->add('name', 'text') 18 ->add('name', TextType::class)
15 ->add('email', 'email') 19 ->add('email', EmailType::class)
16 ->add('twoFactorAuthentication', 'checkbox', array('required' => false)) 20 ->add('twoFactorAuthentication', CheckboxType::class, array('required' => false))
17 ->add('save', 'submit') 21 ->add('save', SubmitType::class)
18 ->remove('username') 22 ->remove('username')
19 ->remove('plainPassword') 23 ->remove('plainPassword')
20 ; 24 ;
@@ -32,7 +36,7 @@ class UserInformationType extends AbstractType
32 )); 36 ));
33 } 37 }
34 38
35 public function getName() 39 public function getBlockPrefix()
36 { 40 {
37 return 'update_user'; 41 return 'update_user';
38 } 42 }