Completed
Push — develop ( 20c46c...1407ca )
by Novikov
02:15
created

CronType::configureOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4286
1
<?php
2
3
namespace FOA\CronBundle\Form\Type;
4
5
use Symfony\Component\Form\FormBuilderInterface;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
9
/**
10
 * Cron job form type
11
 */
12
class CronType extends AbstractType
13
{
14
    public function buildForm(FormBuilderInterface $builder, array $options)
15
    {
16
        $builder
17
            ->add('minute')
18
            ->add('hour')
19
            ->add('dayOfMonth')
20
            ->add('month')
21
            ->add('dayOfWeek')
22
            ->add('command')
23
            ->add('logFile', 'text', array(
24
                'required' => false,
25
            ))
26
            ->add('errorFile', 'text', array(
27
                'required' => false,
28
            ))
29
            ->add('comment', 'text', array(
30
                'required' => false,
31
            ));
32
    }
33
34
    public function configureOptions(OptionsResolver $resolver)
35
    {
36
        $resolver->setDefaults(array(
37
            'data_class' => 'FOA\CronBundle\Manager\Cron'
38
        ));
39
    }
40
41
    /**
42
     * Returns the name of this type.
43
     *
44
     * @return string The name of this type
45
     */
46
    function getName()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
47
    {
48
        return 'cron';
49
    }
50
}
51