Completed
Push — master ( 252709...a30575 )
by Adrian
05:03
created

src/Manager/ModelManagerServiceProvider.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace ANavallaSuiza\Laravel\Database\Manager;
3
4
use Illuminate\Support\ServiceProvider;
5
use ANavallaSuiza\Laravel\Database\Manager\Eloquent\ModelManager;
6
use ANavallaSuiza\Laravel\Database\Console\Commands\SchemaUpdate;
7
8
class ModelManagerServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17 21
    public function boot()
18
    {
19 21
        $this->publishes([
20 21
            __DIR__.'/../../config/laravel-database.php' => config_path('laravel-database.php'),
21 21
        ], 'config');
22 21
    }
23
24
    /**
25
     * Register the service provider.
26
     *
27
     * @return void
28
     */
29 21
    public function register()
30
    {
31 21
        $this->mergeConfigFrom(__DIR__.'/../../config/laravel-database.php', 'laravel-database');
32
33 21
        $this->app->bind('ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager', function($app) {
34
            return new ModelManager($app);
35 21
        });
36
37 21
        $this->registerCommands();
38 21
    }
39
40 21
    protected function registerCommands()
41
    {
42
        /*$this->app->singleton('command.database.schema-update', function ($app) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
43
            $console = $app->make('Illuminate\Contracts\Console\Kernel');
44
45
            return new SchemaUpdate($app, $console);
46
        });
47
48
        $this->commands('command.database.schema-update');*/
49 21
    }
50
51
    /**
52
     * Get the services provided by the provider.
53
     *
54
     * @return array
55
     */
56 1
    public function provides()
57
    {
58
        return [
59 1
            'ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager',
60
            //'command.database.schema-update'
61 1
        ];
62
    }
63
}
64