FlavyServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 28
c 0
b 0
f 0
rs 10

2 Methods

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