NativeSessionServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 18 1
1
<?php declare(strict_types=1);
2
3
namespace CustomerGauge\Session;
4
5
use Illuminate\Container\Container;
6
use Illuminate\Contracts\Config\Repository;
7
use Illuminate\Support\Facades\Auth;
8
use Illuminate\Support\ServiceProvider;
9
10
final class NativeSessionServiceProvider extends ServiceProvider
11
{
12
    public function register()
13
    {
14
        Auth::provider(NativeSessionUserProvider::class, function () {
15
            return $this->app->make(NativeSessionUserProvider::class);
16
        });
17
18
        Auth::extend(NativeSessionGuard::class, function (Container $app) {
19
            return $app->make(NativeSessionGuard::class);
20
        });
21
22
        $this->app->singleton(SessionRetriever::class, function () {
23
            $config = $this->app->make(Repository::class);
24
            
25
            $path = $config->get('auth.guards.php.storage');
26
27
            $domain = $config->get('auth.guards.php.domain');
28
29
            return new SessionRetriever($path, $domain);
30
        });
31
    }
32
}
33
34