HtmlServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A provides() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\LaravelHtml;
6
7
use Arcanedev\LaravelHtml\Contracts\FormBuilder as FormBuilderContract;
8
use Arcanedev\LaravelHtml\Contracts\HtmlBuilder as HtmlBuilderContract;
9
use Arcanedev\Support\Providers\ServiceProvider;
10
use Illuminate\Contracts\Support\DeferrableProvider;
11
12
/**
13
 * Class     HtmlServiceProvider
14
 *
15
 * @author   ARCANEDEV <[email protected]>
16
 */
17
class HtmlServiceProvider extends ServiceProvider implements DeferrableProvider
18
{
19
    /* -----------------------------------------------------------------
20
     |  Main Methods
21
     | -----------------------------------------------------------------
22
     */
23
24
    /**
25
     * Register the service provider.
26
     */
27 780
    public function register(): void
28
    {
29 780
        parent::register();
30
31 260
        $this->singleton(HtmlBuilderContract::class, HtmlBuilder::class);
32 260
        $this->singleton(FormBuilderContract::class, FormBuilder::class);
33 780
    }
34
35
    /**
36
     * Get the services provided by the provider.
37
     *
38
     * @return array
39
     */
40 4
    public function provides(): array
41
    {
42
        return [
43 4
            HtmlBuilderContract::class,
44
            FormBuilderContract::class,
45
        ];
46
    }
47
}
48