ImaginaryServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ArjanWestdorp\Imaginary\Laravel;
4
5
use ArjanWestdorp\Imaginary\Client;
6
use Illuminate\Support\ServiceProvider;
7
8
class ImaginaryServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15 3
    public function boot()
16
    {
17 3
        $this->publishes([
18 3
            __DIR__ . '/../config/imaginary.php' => config_path('imaginary.php'),
19 3
        ], 'config');
20 3
    }
21
22
    /**
23
     * Register the application services.
24
     *
25
     * @return void
26
     */
27 3
    public function register()
28
    {
29 3
        $this->mergeConfigFrom(
30 3
            __DIR__ . '/../config/imaginary.php', 'imaginary'
31 3
        );
32
33 3
        $this->app->bind('imaginary.client', function () {
34 3
            return new Client(config('imaginary'));
35 3
        });
36 3
    }
37
}
38