ImportForm::buildForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php namespace Distilleries\Expendable\Http\Forms\Import;
2
3
use Distilleries\Expendable\Helpers\StaticLabel;
4
use Distilleries\FormBuilder\FormValidator;
5
6
class ImportForm extends FormValidator {
7
8
    public static $rules = [
9
        'file' => 'required'
10
    ];
11
12
    public static $rules_update = null;
13
14
    // ------------------------------------------------------------------------------------------------
15
16 8
    public function buildForm()
17
    {
18
19
        $this
20 8
            ->add('file', 'upload',
21
                [
22 8
                    'label'      => trans('expendable::form.file_import'),
23 8
                    'validation' => 'required',
24 8
                    'extensions' => 'csv,xls,xlsx',
25 8
                    'view'       => 'files',
26
                ])
27 8
            ->addDefaultActions();
28
    }
29
}