DynamicRoutingServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace ElementsFramework\DynamicRouting;
4
5
6
use Illuminate\Support\ServiceProvider;
7
8
class DynamicRoutingServiceProvider extends ServiceProvider
9
{
10
11
    /**
12
     * Bootstraps the package.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        // Migrations
19
        $this->loadMigrationsFrom(__DIR__ . '/Migration');
20
21
        // Configuration publishing
22
        $this->publishes([
23
            __DIR__.'/Configuration/dynamic-routing.php' => config_path('dynamic-routing.php'),
24
        ]);
25
        $this->mergeConfigFrom(
26
            __DIR__.'/Configuration/dynamic-routing.php', 'dynamic-routing'
27
        );
28
    }
29
30
    /**
31
     * Register the application services.
32
     *
33
     * @return void
34
     */
35
    public function register()
36
    {
37
        // Commands
38
        $this->commands([
39
            Console\CompileRoutesCommand::class,
40
            Console\PublishProvidedRoutesCommand::class,
41
            Console\CleanupProvidedRoutesCommand::class,
42
            Console\SyncProvidedRoutesCommand::class,
43
        ]);
44
45
        // Services
46
        $this->app->bind('ElementsFramework\DynamicRouting\Service\Compiler\RouteDeclarationCompiler', 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...
47
            return new Service\Compiler\RouteDeclarationCompiler();
48
        });
49
        $this->app->bind('ElementsFramework\DynamicRouting\Service\Publishing\RoutePublisher', 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...
50
            return new Service\Publishing\RoutePublisher();
51
        });
52
    }
53
54
}