Test Failed
Push — develop ( f4fb9d...b64f53 )
by Nikita
06:04 queued 11s
created

RouteServiceProvider   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
eloc 19
c 2
b 0
f 0
dl 0
loc 77
ccs 19
cts 19
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A map() 0 7 1
A boot() 0 3 1
A mapApiRoutes() 0 7 1
A mapWebRoutes() 0 5 1
A mapGdaemonApiRoutes() 0 7 1
1
<?php
2
3
namespace Gameap\Providers;
4
5
use Illuminate\Support\Facades\Route;
6
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7
8
class RouteServiceProvider extends ServiceProvider
9
{
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 = 'Gameap\Http\Controllers';
18
19
    /**
20
     * Define your route model bindings, pattern filters, etc.
21
     *
22
     * @return void
23
     */
24 111
    public function boot()
25
    {
26
        parent::boot();
27
    }
28 111
29 111
    /**
30
     * Define the routes for the application.
31
     *
32
     * @return void
33
     */
34
    public function map()
35
    {
36 111
        $this->mapApiRoutes();
37
38 111
        $this->mapWebRoutes();
39
40 111
        $this->mapGdaemonApiRoutes();
41
    }
42
43 111
    /**
44
     * Define the "web" routes for the application.
45
     *
46
     * These routes all receive session state, CSRF protection, etc.
47
     *
48
     * @return void
49
     */
50
    protected function mapWebRoutes()
51
    {
52 111
        Route::middleware('web')
53
            ->namespace($this->namespace)
54 111
            ->group(base_path('routes/web.php'));
55 111
    }
56 111
57 111
    /**
58
     * Define the "api" routes for the application.
59
     *
60
     * These routes are typically stateless.
61
     *
62
     * @return void
63
     */
64
    protected function mapApiRoutes()
65
    {
66 111
        Route::prefix('api')
67
            ->middleware('api')
68
            ->as('api.')
69
            ->namespace($this->namespace . "\\API")
70
            ->group(base_path('routes/api.php'));
71
    }
72
73 111
    /**
74 111
     * Define the "gdaemon_api" routes for the application
75 111
     *
76 111
     * @return void
77 111
     */
78 111
    protected function mapGdaemonApiRoutes()
79
    {
80
        Route::prefix('gdaemon_api')
81
            ->middleware('gdaemon_api')
82
            ->as('gdaemon_api.')
83
            ->namespace($this->namespace . "\\GdaemonAPI")
84
            ->group(base_path('routes/gdaemon_api.php'));
85
    }
86
}
87