buildView()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 3
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