Completed
Push — master ( 8a32e8...44da47 )
by Fèvre
21s queued 14s
created

FormServiceProvider::boot()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 66
Code Lines 55

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 55
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 66
rs 8.9818

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
namespace Xetaravel\Providers;
3
4
use Collective\Html\FormFacade as Form;
5
use Illuminate\Support\ServiceProvider;
6
7
class FormServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap any application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        // Collective Form
17
        Form::component('bsText', 'components.form.text', [
18
            'name',
19
            'label' => null,
20
            'value' => null,
21
            'attributes' => [],
22
            'labelClass' => 'form-control-label'
23
        ]);
24
        Form::component('bsEmail', 'components.form.email', [
25
            'name',
26
            'label' => null,
27
            'value' => null,
28
            'attributes' => []
29
        ]);
30
        Form::component('bsNumber', 'components.form.number', [
31
            'name',
32
            'label' => null,
33
            'value' => null,
34
            'attributes' => []
35
        ]);
36
        Form::component('bsTextarea', 'components.form.textarea', [
37
            'name',
38
            'label' => null,
39
            'value' => null,
40
            'attributes' => [],
41
            'labelClass' => 'form-control-label'
42
        ]);
43
        Form::component('bsPassword', 'components.form.password', ['name', 'label' => null, 'attributes' => []]);
44
        Form::component('bsCheckbox', 'components.form.checkbox', [
45
            'name',
46
            'value' => 1,
47
            'checked' => null,
48
            'label' => null,
49
            'attributes' => [],
50
            'labelClass' => 'form-control-label'
51
        ]);
52
        Form::component('bsRadio', 'components.form.radio', [
53
            'name',
54
            'value' => 1,
55
            'checked' => null,
56
            'label' => null,
57
            'attributes' => [],
58
            'labelClass' => 'form-control-label'
59
        ]);
60
        Form::component('bsInputGroup', 'components.form.input-group', [
61
            'name',
62
            'label' => null,
63
            'value' => null,
64
            'attributes' => []
65
        ]);
66
        Form::component('bsSelect', 'components.form.select', [
67
            'name',
68
            'list' => [],
69
            'label' => null,
70
            'selected' => null,
71
            'attributes' => [],
72
            'optionsAttributes' => [],
73
            'labelClass' => 'form-control-label'
74
        ]);
75
        Form::component('bsNewsletter', 'components.form.newsletter', [
76
            'name',
77
            'label' => null,
78
            'value' => null,
79
            'attributes' => []
80
        ]);
81
    }
82
}
83