ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace ThinkOne\LaravelSproutsocialsApi;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
    /**
8
     * Bootstrap the application services.
9
     * @codeCoverageIgnore
10
     */
11
    public function boot()
12
    {
13
        if ($this->app->runningInConsole()) {
14
            $this->publishes([
15
                __DIR__ . '/../config/sproutsocials-api.php' => config_path('sproutsocials-api.php'),
16
            ], 'config');
17
        }
18
    }
19
20
    /**
21
     * Register the application services.
22
     * @codeCoverageIgnore
23
     */
24
    public function register()
25
    {
26
        $this->mergeConfigFrom(__DIR__ . '/../config/sproutsocials-api.php', 'sproutsocials-api');
27
28
        $this->app->bind('sproutsocials-api', function () {
29
            return new SproutsocialsApi(config('sproutsocials-api.http'));
30
        });
31
    }
32
}
33