TimestampType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
3
/*
4
 * This file is part of the Bukashk0zzzTimestampTypeBundle
5
 *
6
 * (c) Denis Golubovskiy <[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 Bukashk0zzz\TimestampTypeBundle\Form\Type;
13
14
use Bukashk0zzz\TimestampTypeBundle\Form\DataTransformer\TimestampToDateTimeTransformer;
15
use Symfony\Component\Form\AbstractType;
16
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
17
use Symfony\Component\Form\FormBuilderInterface;
18
19
/**
20
 * Class TimestampType
21
 */
22
class TimestampType extends AbstractType
23
{
24
    /**
25
     * @param FormBuilderInterface $builder
26
     * @param mixed[]              $options
27
     */
28
    public function buildForm(FormBuilderInterface $builder, array $options): void
29
    {
30
        $builder->addModelTransformer(new TimestampToDateTimeTransformer());
31
    }
32
33
    /**
34
     * @return mixed
35
     */
36
    public function getParent()
37
    {
38
        return IntegerType::class;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getBlockPrefix(): string
45
    {
46
        return 'integer';
47
    }
48
}
49