LaravelImgurServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 2
b 0
f 0
nc 2
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Luilliarcec\LaravelImgur;
4
5
use Illuminate\Support\ServiceProvider;
6
use Luilliarcec\LaravelImgur\Support\LaravelImgur;
7
8
class LaravelImgurServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        if ($this->app->runningInConsole()) {
16
            $this->publishes([
17
                __DIR__.'/../config/config.php' => config_path('imgur.php'),
18
            ], 'config');
19
        }
20
    }
21
22
    /**
23
     * Register the application services.
24
     */
25
    public function register()
26
    {
27
        // Automatically apply the package configuration
28
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'imgur');
29
30
        // Register the main class to use with the facade
31
        $this->app->singleton('LaravelImgur', function () {
32
            return new LaravelImgur;
33
        });
34
    }
35
}
36