DbMigrationsServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A provides() 0 4 1
A register() 0 16 1
1
<?php namespace Nwidart\DbExporter;
2
3
use Illuminate\Support\ServiceProvider;
4
use Illuminate\Support\Facades\Config;
5
6
class DbMigrationsServiceProvider extends ServiceProvider {
7
8
    /**
9
     * Indicates if loading of the provider is deferred.
10
     *
11
     * @var bool
12
     */
13
    protected $defer = false;
14
15
    /**
16
     * Bootstrap the application events.
17
     *
18
     * @return void
19
     */
20
    public function boot()
21
    {
22
        //
23
    }
24
25
    /**
26
     * Register the service provider.
27
     *
28
     * @return void
29
     */
30
    public function register()
31
    {
32
33
        $this->app['DbMigrations'] = $this->app->share(function()
0 ignored issues
show
Bug introduced by
The method share() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
        {
35
            $connType = config('database.default');
36
            $database = config('database.connections.' .$connType );
37
            return new DbMigrations($database);
38
        });
39
40
        $this->app->booting(function()
41
            {
42
                $loader = \Illuminate\Foundation\AliasLoader::getInstance();
43
                $loader->alias('DbMigrations', 'Nwidart\DbExporter\Facades\DbMigrations');
44
            });
45
    }
46
47
    /**
48
     * Get the services provided by the provider.
49
     *
50
     * @return array
51
     */
52
    public function provides()
53
    {
54
        return array('DbMigrations');
55
    }
56
57
}