Completed
Push — master ( 1b1851...ca855b )
by Antonio Carlos
02:46 queued 01:09
created

ServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 2
dl 0
loc 41
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A configurePaths() 0 6 1
A mergeConfig() 0 6 1
A register() 0 6 1
A boot() 0 6 1
1
<?php
2
3
namespace PragmaRX\Google2FALaravel;
4
5
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
6
7
class ServiceProvider extends IlluminateServiceProvider
8
{
9
    /**
10
     * Configure package paths.
11
     */
12 14
    private function configurePaths()
13
    {
14 14
        $this->publishes([
15 14
            __DIR__.'/config/config.php' => config_path('google2fa.php'),
16
        ]);
17 14
    }
18
19
    /**
20
     * Merge configuration.
21
     */
22 14
    private function mergeConfig()
23
    {
24 14
        $this->mergeConfigFrom(
25 14
            __DIR__.'/config/config.php', 'google2fa'
26
        );
27 14
    }
28
29
    /**
30
     * Register the service provider.
31
     *
32
     * @return void
33
     */
34 14
    public function register()
35
    {
36
        $this->app->singleton('pragmarx.google2fa', function ($app) {
37 8
            return $app->make(Google2FA::class);
38 14
        });
39 14
    }
40
41 14
    public function boot()
42
    {
43 14
        $this->configurePaths();
44
45 14
        $this->mergeConfig();
46 14
    }
47
}
48