• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rich-id / terms-module / #64

11 Oct 2023 03:35PM UTC coverage: 83.731%. First build
#64

push

web-flow
Merge b679837ca into b062eebb9

146 of 146 new or added lines in 12 files covered. (100.0%)

772 of 922 relevant lines covered (83.73%)

3.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Infrastructure/FormType/SignatureListFormType.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace RichId\TermsModuleBundle\Infrastructure\FormType;
6

7
use Doctrine\ORM\EntityRepository;
8
use RichId\TermsModuleBundle\Domain\Entity\Terms;
9
use RichId\TermsModuleBundle\Domain\Model\SignatureListForm;
10
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
11
use Symfony\Component\Form\AbstractType;
12
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
13
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
14
use Symfony\Component\Form\Extension\Core\Type\TextType;
15
use Symfony\Component\Form\FormBuilderInterface;
16
use Symfony\Component\OptionsResolver\OptionsResolver;
17

18
class SignatureListFormType extends AbstractType
19
{
20
    /* @phpstan-ignore-next-line */
21
    public function buildForm(FormBuilderInterface $builder, array $options): void
22
    {
23
        $builder
24
            ->add(
×
25
                'search',
×
26
                TextType::class,
×
27
                [
28
                    'required' => false,
×
29
                    'attr'     => [
30
                        'placeholder' => 'terms_module.pdf_signature.placeholder.search',
31
                    ],
32
                    'translation_domain' => 'terms_module',
33
                    'label'              => false,
34
                ]
35
            )
36
            ->add(
×
37
                'terms',
×
38
                EntityType::class,
×
39
                [
40
                    'required'           => false,
×
41
                    'class'              => Terms::class,
42
                    'choice_label'       => 'name',
×
43
                    'placeholder'        => 'terms_module.pdf_signature.placeholder.terms',
×
44
                    'translation_domain' => 'terms_module',
×
45
                    'label'              => false,
46
                    'query_builder'      => static function (EntityRepository $er) {
×
47
                        return $er->createQueryBuilder('t')->orderBy('t.name', 'ASC');
×
48
                    },
×
49
                ]
50
            )
51
            ->add(
×
52
                'numberItemsPerPage',
×
53
                ChoiceType::class,
×
54
                [
55
                    'required'           => true,
×
56
                    'empty_data'         => 10,
57
                    'label'              => 'terms_module.pdf_signature.placeholder.number_items_per_page',
58
                    'translation_domain' => 'terms_module',
59
                    'choices'            => [
60
                        10 => 10,
61
                        20 => 20,
62
                        50 => 50,
63
                    ],
64
                ]
65
            )
66
            ->add(
×
67
                'page',
×
68
                HiddenType::class,
×
69
                [
70
                    'required'   => false,
×
71
                    'empty_data' => 1,
72
                ]
73
            )
74
            ->add(
×
75
                'sort',
×
76
                HiddenType::class,
×
77
                [
78
                    'required'   => false,
×
79
                    'empty_data' => SignatureListForm::SORT_SIGNATORY,
80
                ]
81
            )
82
            ->add(
×
83
                'sortDirection',
×
84
                HiddenType::class,
×
85
                [
86
                    'required'   => false,
×
87
                    'empty_data' => SignatureListForm::SORT_DESC,
88
                ]
89
            )
90
        ;
91
    }
×
92

93
    public function configureOptions(OptionsResolver $resolver): void
94
    {
95
        $resolver->setDefaults(
×
96
            [
97
                'data_class' => SignatureListForm::class,
×
98
                'method'     => 'GET',
99
            ]
100
        );
101
    }
×
102
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc