Passed
Pull Request — master (#6)
by Mattia
32:50 queued 25:28
created

PagOnlineServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace PagOnline\Laravel;
4
5
use Illuminate\Support\ServiceProvider;
6
use PagOnline\IgfsCgFactory;
7
8
/**
9
 * Class PagOnlineServiceProvider.
10
 */
11
class PagOnlineServiceProvider extends ServiceProvider
12
{
13 1
    public function boot()
14
    {
15 1
        $this->registerPublishing();
16
    }
17
18
    /**
19
     * Register resources that can be published.
20
     */
21 1
    public function registerPublishing()
22
    {
23 1
        $this->publishes([
24 1
            __DIR__.'/../../config/pagonline.php' => config_path('pagonline.php'),
25 1
        ], 'pagonline-config');
26
    }
27
28 1
    public function register()
29
    {
30 1
        $this->mergeConfigFrom(
31 1
            __DIR__.'/../../config/pagonline.php', 'pagonline'
32 1
        );
33 1
        $this->registerFactory();
34
    }
35
36
    /**
37
     * Register Factory Facade.
38
     */
39 1
    public function registerFactory()
40
    {
41 1
        $this->app->singleton('igfscg', function () {
42
            return new IgfsCgFactory();
43 1
        });
44 1
        $this->app->alias('igfscg', IgfsCgFactory::class);
45
    }
46
}
47