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

PagOnlineServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 93.75%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 11
c 2
b 1
f 0
dl 0
loc 34
ccs 15
cts 16
cp 0.9375
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 3 1
A registerPublishing() 0 5 1
A register() 0 6 1
A registerFactory() 0 6 1
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