Passed
Pull Request — master (#7)
by Koen
05:32
created

SPAServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Providers;
6
7
use App\SPA\UrlGenerator;
8
use Illuminate\Contracts\Config\Repository;
9
use Illuminate\Support\ServiceProvider;
10
11
final class SPAServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Register any application services.
15
     *
16
     * @return void
17
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
18
     */
19 47
    public function register(): void
20
    {
21
        /** @var \Illuminate\Contracts\Config\Repository $config */
22 47
        $config = $this->app->make(Repository::class);
23
24 47
        $this->app->singleton(UrlGenerator::class, fn() => new UrlGenerator($config->get('spa.url')));
25 47
    }
26
27
    /**
28
     * Bootstrap any application services.
29
     *
30
     * @return void
31
     */
32 47
    public function boot(): void
33
    {
34
        //
35 47
    }
36
}
37