ExpendableRouteServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 17
c 1
b 0
f 0
dl 0
loc 74
ccs 17
cts 17
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A mapWebRoutes() 0 9 1
A mapApiRoutes() 0 8 1
A map() 0 5 1
A boot() 0 3 1
1
<?php namespace Distilleries\Expendable;
2
3
use Distilleries\Expendable\Http\Router\Router;
4
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
5
6
class ExpendableRouteServiceProvider extends ServiceProvider
7
{
8
9
    protected $router;
10
    /**
11
     * This namespace is applied to your controller routes.
12
     *
13
     * In addition, it is set as the URL generator's root namespace.
14
     *
15
     * @var string
16
     */
17
    protected $namespace = 'Distilleries\Expendable\Http\Controllers';
18
19
20
21
    /**
22
     * Define your route model bindings, pattern filters, etc.
23
     *
24
     * @return void
25
     */
26 288
    public function boot()
27
    {
28 288
        parent::boot();
29
    }
30
31
    /**
32
     * Define the routes for the application.
33
     *
34
     * @return void
35
     */
36 288
    public function map()
37
    {
38 288
        $this->mapWebRoutes();
39
40 288
        $this->mapApiRoutes();
41
42
        //
43
    }
44
    
45
46
    /**
47
     * Define the "web" routes for the application.
48
     *
49
     * These routes all receive session state, CSRF protection, etc.
50
     *
51
     * @return void
52
     */
53 288
    protected function mapWebRoutes()
54
    {
55
56 288
        \Route::group([
57 288
            'middleware' => 'web',
58 288
            'namespace'  => $this->namespace,
59
        ], function($router) {
60
61 288
            require __DIR__.'/../routes/web.php';
62 288
        });
63
    }
64
65
    /**
66
     * Define the "api" routes for the application.
67
     *
68
     * These routes are typically stateless.
69
     *
70
     * @return void
71
     */
72 288
    protected function mapApiRoutes()
73
    {
74 288
        \Route::group([
75 288
            'middleware' => 'api',
76 288
            'namespace'  => $this->namespace,
77 288
            'prefix'     => 'api',
78
        ], function($router) {
79 288
            require __DIR__.'/../routes/api.php';
80 288
        });
81
    }
82
}
83