MollieGatewayMethodsAutocompleteChoiceType   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 26
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A buildView() 0 4 1
A getBlockPrefix() 0 3 1
A configureOptions() 0 7 1
A getParent() 0 3 1
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * You can find more information about us on https://bitbag.io and write us
7
 * an email on [email protected].
8
 */
9
10
declare(strict_types=1);
11
12
namespace BitBag\SyliusMolliePlugin\Form\Type;
13
14
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceAutocompleteChoiceType;
15
use Symfony\Component\Form\AbstractType;
16
use Symfony\Component\Form\FormInterface;
17
use Symfony\Component\Form\FormView;
18
use Symfony\Component\OptionsResolver\OptionsResolver;
19
20
final class MollieGatewayMethodsAutocompleteChoiceType extends AbstractType
21
{
22
    public function configureOptions(OptionsResolver $resolver): void
23
    {
24
        $resolver->setDefaults([
25
            'resource' => 'bitbag_sylius_mollie_plugin.mollie_gateway_config',
26
            'choice_name' => 'methodId',
27
            'choice_value' => 'id',
28
            'label' => false,
29
        ]);
30
    }
31
32
    public function buildView(FormView $view, FormInterface $form, array $options): void
33
    {
34
        $view->vars['remote_criteria_type'] = 'contains';
35
        $view->vars['remote_criteria_name'] = 'methodId';
36
    }
37
38
    public function getBlockPrefix(): string
39
    {
40
        return 'bitbag_sylius_mollie_plugin_mollie_gateway_config_autocomplete_choice';
41
    }
42
43
    public function getParent(): string
44
    {
45
        return ResourceAutocompleteChoiceType::class;
46
    }
47
}
48