LarachimpServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 32
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 9 1
1
<?php namespace DiegoCaprioli\Larachimp\Providers;
2
3
use DiegoCaprioli\Larachimp\Services\Larachimp;
4
use Illuminate\Support\ServiceProvider;
5
6
class LarachimpServiceProvider extends ServiceProvider {
7
8
    /**
9
     * Register paths to be published by the publish command.
10
     *
11
     * @return void
12
     */
13 6
    public function boot()
14
    {
15 6
        $this->publishes([
16 6
            __DIR__ . '../../config/larachimp.php' => config_path('diegocaprioli/larachimp/larachimp.php')
17 6
        ]);
18 6
    }
19
20
21
    /**
22
     * Register bindings in the container.
23
     *
24
     * @return void
25
     */
26
    public function register()
27
    {
28 6
        $this->app->singleton('diegocaprioli_larachimp', function($app) {
29 6
            $config = config('diegocaprioli.larachimp.larachimp');
30 6
            $larachimp = new Larachimp($app->make('log'));
31 6
            $larachimp->initialize($config['api_key'], $config['base_uri']);
32 6
            return $larachimp;
33 6
        });
34 6
    }
35
36
37
}