DateTimePickerType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParent() 0 4 1
A configureOptions() 0 9 1
A getBlockPrefix() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of AppName.
5
 *
6
 * (c) Monofony
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 App\Form\Type;
13
14
use Symfony\Component\Form\AbstractType;
15
use Symfony\Component\Form\Extension\Core\Type\DateType;
16
use Symfony\Component\OptionsResolver\OptionsResolver;
17
18
class DateTimePickerType extends AbstractType
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getParent()
24
    {
25
        return DateType::class;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function configureOptions(OptionsResolver $resolver)
32
    {
33
        parent::configureOptions($resolver);
34
35
        $resolver->setDefaults([
36
            'widget' => 'single_text',
37
            'format' => 'dd/MM/yyyy H:i',
38
        ]);
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getBlockPrefix()
45
    {
46
        return 'app_date_time_picker';
47
    }
48
}
49