GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 6810e8...b8e0b3 )
by Albert
02:09
created

DbExportHandlerServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php 
2
namespace Elimuswift\DbExporter;
3
4
use Illuminate\Support\ServiceProvider;
5
use Illuminate\Support\Facades\Config;
6
7
8
class DbExportHandlerServiceProvider extends ServiceProvider
9
{
10
    protected $defer = false;
11
12
    /**
13
     * @var DbMigrations $migrator
14
     */
15
    protected $migrator;
16
17
    /**
18
     * @var DbSeeding $seeder
19
     */
20
    protected $seeder;
21
    /**
22
     * @var DbExportHandler $handler
23
     */
24
    protected $handler;
25
26
    public function boot(DbMigrations $migrator)
27
    {
28
        // Instatiate a new DbMigrations class to send to the handler
29
        $this->migrator = $migrator;
30
31
        // Instatiate a new DbSeeding class to send to the handler
32
        $this->seeder = new DbSeeding($migrator->database);
33
34
        // Instantiate the handler
35
        $this->handler = new DbExportHandler($this->migrator, $this->seeder);
36
    }
37
38
    public function register()
39
    {
40
         $this->publishes([
41
            realpath(__DIR__ .'/../').'/config/db-exporter.php' => config_path('db-exporter.php'),
42
        ]);
43
44
        $this->mergeConfigFrom(
45
            realpath(__DIR__ .'/../').'/config/db-exporter.php', 'db-exporter'
46
        );
47
48
       $this->app->register(DbMigrationsServiceProvider::class);
49
50
        // Load the classes
51
        $this->loadClasses();
52
53
        // Register the base export handler class
54
        $this->registerDbExportHandler();
55
56
        // Handle the artisan commands
57
        $this->registerCommands();
58
59
        // Load the alias
60
        $this->loadAlias();
61
    }
62
63
    /**
64
     * Load to classes
65
     */
66
    protected function loadClasses()
67
    {
68
        
69
    }
70
71
72
    public function provides()
73
    {
74
        return array('DbExportHandler');
75
    }
76
77
    /**
78
     * Register the needed commands
79
     */
80
    public function registerCommands()
81
    {
82
        $this->registerMigrationsCommand();
83
        $this->registerSeedsCommand();
84
        $this->registerRemoteCommand();
85
        $this->commands(
86
            'db-exporter:migrations',
87
            'db-exporter:seeds',
88
            'db-exporter:remote'
89
        );
90
    }
91
92
    /**
93
     * Register the migrations command
94
     */
95
    protected function registerMigrationsCommand()
96
    {
97
        $this->app->bind('db-exporter:migrations', function($app)
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
98
        {
99
            return new Commands\MigrationsGeneratorCommand($this->handler);
100
        });
101
    }
102
103
    /**
104
     * Register the seeds command
105
     */
106
    protected function registerSeedsCommand()
107
    {
108
        $this->app->bind('db-exporter:seeds', function()
109
        {
110
            return new Commands\SeedGeneratorCommand($this->handler);
111
        });
112
    }
113
114
    protected function registerRemoteCommand()
115
    {
116
        $this->app->bind('db-exporter:remote', function()
117
        {
118
            return new Commands\CopyToRemoteCommand(new Server);
119
        });
120
    }
121
122
    /**
123
     * Register the Export handler class
124
     */
125
    protected function registerDbExportHandler()
126
    {
127
        $this->app['DbExportHandler'] = $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...
128
        {
129
            return $this->handler;
130
        });
131
    }
132
133
    /**
134
     * Load the alias = One less install step for the user
135
     */
136
    protected function loadAlias()
137
    {
138
        $this->app->booting(function()
139
        {
140
            $loader = \Illuminate\Foundation\AliasLoader::getInstance();
141
            $loader->alias('DbExportHandler', 'Nwidart\DbExporter\Facades\DbExportHandler');
142
        });
143
    }
144
145
}