FormServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 37
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 25
c 0
b 0
f 0
dl 0
loc 37
rs 9.52
ccs 13
cts 13
cp 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Gameap\Providers;
4
5
use Collective\Html\FormFacade as Form;
6
use Illuminate\Support\ServiceProvider;
7
8
class FormServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15 108
    public function boot(): void
16
    {
17
        view()->composer('*', function (): void {
18 33
            Form::component(
19 33
                'bsInput',
20
                'components.form.input',
21
                ['name', 'options' => []]
22 33
            );
23 33
24
            Form::component(
25
                'bsText',
26 33
                'components.form.text',
27 33
                ['name', 'value' => null, 'label' => null, 'attributes' => []]
28
            );
29
30 33
            Form::component(
31 33
                'bsTextArea',
32
                'components.form.textarea',
33
                ['name', 'value' => null, 'label' => null, 'attributes' => []]
34 33
            );
35 33
36
            Form::component(
37 108
                'bsEmail',
38 108
                'components.form.email',
39
                ['name', 'value' => null, 'label' => null, 'attributes' => []]
40
            );
41
42
            Form::component(
43
                'bsPassword',
44
                'components.form.password',
45
                ['name', 'label' => null, 'attributes' => []]
46
            );
47
48
            Form::component(
49
                'submitButton',
50
                'components.form.submit_button',
51
                ['options' => []],
52
            );
53
        });
54
    }
55
}
56