From 4094ea47712efbe58624ff74daeb1f77c9b0edcf Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 12 Apr 2016 11:36:01 +0200 Subject: Convert array + phpDoc Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter --- .../CoreBundle/Form/Type/EntryFilterType.php | 50 +++++++++++----------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php') 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 public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('readingTime', NumberRangeFilterType::class, array( + ->add('readingTime', NumberRangeFilterType::class, [ 'label' => 'entry.filters.reading_time.label', - )) - ->add('createdAt', DateRangeFilterType::class, array( - 'left_date_options' => array( - 'attr' => array( + ]) + ->add('createdAt', DateRangeFilterType::class, [ + 'left_date_options' => [ + 'attr' => [ 'placeholder' => 'dd/mm/yyyy', - ), + ], 'format' => 'dd/MM/yyyy', 'widget' => 'single_text', - ), - 'right_date_options' => array( - 'attr' => array( + ], + 'right_date_options' => [ + 'attr' => [ 'placeholder' => 'dd/mm/yyyy', - ), + ], 'format' => 'dd/MM/yyyy', 'widget' => 'single_text', - ), + ], 'label' => 'entry.filters.created_at.label', - ) + ] ) - ->add('domainName', TextFilterType::class, array( + ->add('domainName', TextFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; if (strlen($value) <= 2 || empty($value)) { @@ -66,14 +66,14 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, 'label' => 'entry.filters.domain_label', - )) - ->add('isArchived', CheckboxFilterType::class, array( + ]) + ->add('isArchived', CheckboxFilterType::class, [ 'label' => 'entry.filters.archived_label', - )) - ->add('isStarred', CheckboxFilterType::class, array( + ]) + ->add('isStarred', CheckboxFilterType::class, [ 'label' => 'entry.filters.starred_label', - )) - ->add('previewPicture', CheckboxFilterType::class, array( + ]) + ->add('previewPicture', CheckboxFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { if (false === $values['value']) { return; @@ -84,12 +84,12 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, 'label' => 'entry.filters.preview_picture_label', - )) - ->add('language', ChoiceFilterType::class, array( + ]) + ->add('language', ChoiceFilterType::class, [ 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), 'choices_as_values' => true, 'label' => 'entry.filters.language_label', - )) + ]) ; } @@ -100,9 +100,9 @@ class EntryFilterType extends AbstractType public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults(array( + $resolver->setDefaults([ 'csrf_protection' => false, - 'validation_groups' => array('filtering'), - )); + 'validation_groups' => ['filtering'], + ]); } } -- cgit v1.2.3