DateSinceType::getParent()   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
2
namespace Vivait\BootstrapBundle\Form\Type;
3
4
use Symfony\Component\Form\AbstractType;
5
use Symfony\Component\Form\Extension\Core\Type\DateType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8
use Symfony\Component\Form\FormInterface;
9
use Symfony\Component\Form\FormView;
10
11
12
class DateSinceType extends AbstractType
13
{
14
	/**
15
	 * {@inheritdoc}
16
	 */
17
	public function buildForm(FormBuilderInterface $builder, array $options)
18
	{
19
20
	}
21
22
	/**
23
	 * {@inheritdoc}
24
	 */
25
	public function finishView(FormView $view, FormInterface $form, array $options)
26
	{
27
		if ('single_text' === $options['widget']) {
28
			$view->vars['date_moment_pattern'] = strtoupper($options['format']);
29
		}
30
	}
31
32
	public function setDefaultOptions(OptionsResolverInterface $resolver)
33
	{
34
		$resolver->setDefaults(array(
35
			'horizontal_input_wrapper_class' => ''
36
		));
37
	}
38
39
	public function getParent()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
40
	{
41
		return DateType::class;
42
	}
43
44
	public function getName()
45
	{
46
		return 'datesince';
47
	}
48
}
49