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

ServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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