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.

GenderType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParent() 0 3 1
A configureOptions() 0 11 1
A getBlockPrefix() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\Form\Type;
13
14
use Symfony\Component\Form\AbstractType;
15
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
16
use Symfony\Component\OptionsResolver\OptionsResolver;
17
18
final class GenderType extends AbstractType
19
{
20
    public const TYPE_MALE = 'm';
21
22
    public const TYPE_FEMALE = 'f';
23
24
    public function configureOptions(OptionsResolver $resolver): void
25
    {
26
        $resolver->setDefaults([
27
            'choices' => [
28
                'male'   => static::TYPE_MALE,
29
                'female' => static::TYPE_FEMALE,
30
            ],
31
            'choice_label' => static function ($value, $key, $index) {
0 ignored issues
show
Unused Code introduced by
The parameter $index is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

31
            'choice_label' => static function ($value, $key, /** @scrutinizer ignore-unused */ $index) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
                return 'gender.'.$key;
33
            },
34
            'choice_translation_domain' => 'Core23FormBundle',
35
        ]);
36
    }
37
38
    public function getParent()
39
    {
40
        return ChoiceType::class;
41
    }
42
43
    public function getBlockPrefix()
44
    {
45
        return 'gender';
46
    }
47
}
48