DynamicRoutingServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 1
A register() 0 18 1
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
}