FlavyServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php namespace Folour\Flavy\Provider;
2
3
/**
4
 *
5
 * @author Vadim Bova <[email protected]>
6
 * @link   http://github.com/folour | http://vk.com/folour
7
 *
8
 */
9
10
use Folour\Flavy\Flavy;
11
use Illuminate\Support\ServiceProvider;
12
13
class FlavyServiceProvider extends ServiceProvider {
14
15
    /**
16
     * Bootstrap the application events.
17
     *
18
     * @return void
19
     */
20
    public function boot()
21
    {
22
        $configPath = __DIR__ . '/../../../../config/flavy.php';
23
        $publishPath = config_path('flavy.php');
24
25
        $this->publishes([$configPath => $publishPath], 'config');
26
    }
27
28
    /**
29
     * Register the service provider.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->app->singleton('flavy', function() {
36
            return new Flavy(config('flavy'));
37
        });
38
        $this->app->alias('flavy', 'Folour\Flavy\Flavy');
39
    }
40
}