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.
Passed
Push — master ( 0de292...c7f65a )
by Christian
02:22
created

OutputType   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 4 2
A reverseTransform() 0 3 1
A transform() 0 3 1
A configureOptions() 0 6 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\DataTransformerInterface;
16
use Symfony\Component\Form\FormBuilderInterface;
17
use Symfony\Component\OptionsResolver\OptionsResolver;
18
19
final class OutputType extends AbstractType implements DataTransformerInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function buildForm(FormBuilderInterface $builder, array $options)
25
    {
26
        if ('' === $options['empty_data']) {
27
            $builder->addViewTransformer($this);
28
        }
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function configureOptions(OptionsResolver $resolver): void
35
    {
36
        $resolver->setDefaults([
37
            'compound'  => false,
38
            'required'  => false,
39
            'disabled'  => true,
40
        ]);
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function transform($data)
47
    {
48
        return $data;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function reverseTransform($data)
55
    {
56
        return $data ?? '';
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function getBlockPrefix()
63
    {
64
        return 'output';
65
    }
66
}
67