LaravelImgurServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 2
A register() 0 8 1
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