ExportForm::buildForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php namespace Distilleries\Expendable\Http\Forms\Export;
2
3
use Distilleries\Expendable\Helpers\StaticLabel;
4
use Distilleries\FormBuilder\FormValidator;
5
6
class ExportForm extends FormValidator {
7
8
    public static $rules = [
9
        'range' => 'required',
10
        'type'  => 'required'
11
    ];
12
13
    public static $rules_update = null;
14
15
    // ------------------------------------------------------------------------------------------------
16
17 14
    public function buildForm()
18
    {
19
20
        $this
21 14
            ->add('range', 'datepicker',
22
                [
23 14
                    'label'      => trans('expendable::form.date'),
24 14
                    'validation' => 'required',
25
                    'range'      => true
26
                ])
27 14
            ->add('type', 'choice', [
28 14
                'choices'    => StaticLabel::typeExport(),
29 14
                'validation' => 'required',
30 14
                'label'      => trans('expendable::form.type')
31
            ])
32 14
            ->addDefaultActions();
33
    }
34
}