MigrationsGeneratorServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php namespace Xethron\MigrationsGenerator;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class MigrationsGeneratorServiceProvider extends ServiceProvider {
6
7
	/**
8
	 * Indicates if loading of the provider is deferred.
9
	 *
10
	 * @var bool
11
	 */
12
	protected $defer = false;
13
14
	/**
15
	 * Register the service provider.
16
	 *
17
	 * @return void
18
	 */
19
	public function register()
20
	{
21
		$this->app->singleton('migration.generate',
22
            function($app) {
23
                return new MigrateGenerateCommand(
24
                    $app->make('Way\Generators\Generator'),
25
                    $app->make('Way\Generators\Filesystem\Filesystem'),
26
                    $app->make('Way\Generators\Compilers\TemplateCompiler'),
27
                    $app->make('migration.repository'),
28
                    $app->make('config')
29
                );
30
            });
31
32
		$this->commands('migration.generate');
33
34
		// Bind the Repository Interface to $app['migrations.repository']
35
		$this->app->bind('Illuminate\Database\Migrations\MigrationRepositoryInterface', function($app) {
36
			return $app['migration.repository'];
37
		});
38
	}
39
40
	/**
41
	 * Bootstrap the application events.
42
	 *
43
	 * @return void
44
	 */
45
	public function boot()
46
	{
47
	}
48
49
	/**
50
	 * Get the services provided by the provider.
51
	 *
52
	 * @return array
53
	 */
54
	public function provides()
55
	{
56
		return array();
57
	}
58
59
}
60