TrelloServiceProvider::handleConfigs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Gregoriohc\LaravelTrello;
4
5
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
6
7
class TrelloServiceProvider extends LaravelServiceProvider {
8
9
    /**
10
     * Indicates if loading of the provider is deferred.
11
     *
12
     * @var bool
13
     */
14
    protected $defer = false;
15
16
    /**
17
     * Bootstrap the application events.
18
     *
19
     * @return void
20
     */
21
    public function boot() {
22
23
        $this->handleConfigs();
24
    }
25
26
    /**
27
     * Register the service provider.
28
     *
29
     * @return void
30
     */
31
    public function register() {
32
33
        $this->app->singleton("trello", function($app) {
34
            return new Wrapper($app['config']);
35
        });
36
    }
37
38
    /**
39
     * Get the services provided by the provider.
40
     *
41
     * @return array
42
     */
43
    public function provides() {
44
45
        return [];
46
    }
47
48
    private function handleConfigs() {
49
50
        $configPath = __DIR__ . '/../config/trello.php';
51
52
        $this->publishes([$configPath => config_path('trello.php')]);
53
54
        $this->mergeConfigFrom($configPath, 'trello');
55
    }
56
}
57