GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 19b66d...20da4a )
by
unknown
11:55 queued 12s
created

ProductAutocompleteChoiceType::configureOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusReportPlugin\Form\Type;
6
7
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceAutocompleteChoiceType;
8
use Symfony\Component\Form\AbstractType;
9
use Symfony\Component\Form\FormInterface;
10
use Symfony\Component\Form\FormView;
11
use Symfony\Component\OptionsResolver\OptionsResolver;
12
13
final class ProductAutocompleteChoiceType extends AbstractType
14
{
15
    public function configureOptions(OptionsResolver $resolver): void
16
    {
17
        $resolver
18
            ->setRequired([
19
                'remote_url',
20
            ])
21
            ->setDefaults([
22
                'resource' => 'sylius.product',
23
                'choice_value' => 'id',
24
            ])
25
        ;
26
    }
27
28
    public function buildView(FormView $view, FormInterface $form, array $options): void
29
    {
30
        $view->vars['remote_criteria_type'] = 'contains';
31
        $view->vars['remote_criteria_name'] = $options['choice_name'];
32
        $view->vars['remote_url'] = $view->vars['load_edit_url'] = $options['remote_url'];
33
    }
34
35
    public function getBlockPrefix(): string
36
    {
37
        return 'odiseo_product_autocomplete_choice';
38
    }
39
40
    public function getParent(): string
41
    {
42
        return ResourceAutocompleteChoiceType::class;
43
    }
44
}
45