Passed
Pull Request — master (#7)
by Koen
04:19
created

SPAServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 14
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
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 58
    public function register(): void
20
    {
21
        /** @var \Illuminate\Contracts\Config\Repository $config */
22 58
        $config = $this->app->make(Repository::class);
23
24 58
        $this->app->singleton(UrlGenerator::class, fn() => new UrlGenerator($config->get('spa.url')));
25 58
    }
26
}
27