aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-04-12 11:36:01 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-04-12 12:25:29 +0200
commit4094ea47712efbe58624ff74daeb1f77c9b0edcf (patch)
tree3d2c168092d0208e6ba888de969252a54bf0c6c1 /src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
parent7eccbda99f16dc39ee01a0c81ab88293e9b268fd (diff)
downloadwallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.tar.gz
wallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.tar.zst
wallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.zip
Convert array + phpDoc
Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index ec36503b..dcdb3ab7 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -34,28 +34,28 @@ class EntryFilterType extends AbstractType
34 public function buildForm(FormBuilderInterface $builder, array $options) 34 public function buildForm(FormBuilderInterface $builder, array $options)
35 { 35 {
36 $builder 36 $builder
37 ->add('readingTime', NumberRangeFilterType::class, array( 37 ->add('readingTime', NumberRangeFilterType::class, [
38 'label' => 'entry.filters.reading_time.label', 38 'label' => 'entry.filters.reading_time.label',
39 )) 39 ])
40 ->add('createdAt', DateRangeFilterType::class, array( 40 ->add('createdAt', DateRangeFilterType::class, [
41 'left_date_options' => array( 41 'left_date_options' => [
42 'attr' => array( 42 'attr' => [
43 'placeholder' => 'dd/mm/yyyy', 43 'placeholder' => 'dd/mm/yyyy',
44 ), 44 ],
45 'format' => 'dd/MM/yyyy', 45 'format' => 'dd/MM/yyyy',
46 'widget' => 'single_text', 46 'widget' => 'single_text',
47 ), 47 ],
48 'right_date_options' => array( 48 'right_date_options' => [
49 'attr' => array( 49 'attr' => [
50 'placeholder' => 'dd/mm/yyyy', 50 'placeholder' => 'dd/mm/yyyy',
51 ), 51 ],
52 'format' => 'dd/MM/yyyy', 52 'format' => 'dd/MM/yyyy',
53 'widget' => 'single_text', 53 'widget' => 'single_text',
54 ), 54 ],
55 'label' => 'entry.filters.created_at.label', 55 'label' => 'entry.filters.created_at.label',
56 ) 56 ]
57 ) 57 )
58 ->add('domainName', TextFilterType::class, array( 58 ->add('domainName', TextFilterType::class, [
59 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 59 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
60 $value = $values['value']; 60 $value = $values['value'];
61 if (strlen($value) <= 2 || empty($value)) { 61 if (strlen($value) <= 2 || empty($value)) {
@@ -66,14 +66,14 @@ class EntryFilterType extends AbstractType
66 return $filterQuery->createCondition($expression); 66 return $filterQuery->createCondition($expression);
67 }, 67 },
68 'label' => 'entry.filters.domain_label', 68 'label' => 'entry.filters.domain_label',
69 )) 69 ])
70 ->add('isArchived', CheckboxFilterType::class, array( 70 ->add('isArchived', CheckboxFilterType::class, [
71 'label' => 'entry.filters.archived_label', 71 'label' => 'entry.filters.archived_label',
72 )) 72 ])
73 ->add('isStarred', CheckboxFilterType::class, array( 73 ->add('isStarred', CheckboxFilterType::class, [
74 'label' => 'entry.filters.starred_label', 74 'label' => 'entry.filters.starred_label',
75 )) 75 ])
76 ->add('previewPicture', CheckboxFilterType::class, array( 76 ->add('previewPicture', CheckboxFilterType::class, [
77 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 77 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
78 if (false === $values['value']) { 78 if (false === $values['value']) {
79 return; 79 return;
@@ -84,12 +84,12 @@ class EntryFilterType extends AbstractType
84 return $filterQuery->createCondition($expression); 84 return $filterQuery->createCondition($expression);
85 }, 85 },
86 'label' => 'entry.filters.preview_picture_label', 86 'label' => 'entry.filters.preview_picture_label',
87 )) 87 ])
88 ->add('language', ChoiceFilterType::class, array( 88 ->add('language', ChoiceFilterType::class, [
89 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), 89 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
90 'choices_as_values' => true, 90 'choices_as_values' => true,
91 'label' => 'entry.filters.language_label', 91 'label' => 'entry.filters.language_label',
92 )) 92 ])
93 ; 93 ;
94 } 94 }
95 95
@@ -100,9 +100,9 @@ class EntryFilterType extends AbstractType
100 100
101 public function configureOptions(OptionsResolver $resolver) 101 public function configureOptions(OptionsResolver $resolver)
102 { 102 {
103 $resolver->setDefaults(array( 103 $resolver->setDefaults([
104 'csrf_protection' => false, 104 'csrf_protection' => false,
105 'validation_groups' => array('filtering'), 105 'validation_groups' => ['filtering'],
106 )); 106 ]);
107 } 107 }
108} 108}