UnicomponentServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 6 1
A provides() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: reallyli
5
 * Date: 18/10/11
6
 * Time: 上午11:28.
7
 */
8
9
namespace Reallyli\LaravelUnicomponent;
10
11
use Illuminate\Support\ServiceProvider;
12
13
class UnicomponentServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * Bootstrap the application services.
17
     */
18
    public function boot()
19
    {
20
        $this->publishes([
21
            __DIR__.'/../config/unicomponent.php' => config_path('unicomponent.php'),
22
        ], 'config');
23
    }
24
25
    /**
26
     * @return void
27
     */
28
    public function register()
29
    {
30
        $this->app->singleton('unicomponent', function ($app) {
31
            return new UnicomponentServiceManager($app['config']['unicomponent']);
32
        });
33
    }
34
35
    /**s
36
     * @return array
37
     */
38
    public function provides()
39
    {
40
        return ['unicomponent'];
41
    }
42
}
43