LarachimpServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 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
}