Test Failed
Push — master ( b80488...89d0f8 )
by Arthur
04:48
created

RouteServiceProvider::mapWebRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Foundation\Providers;
4
5
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
6
use Illuminate\Support\Facades\Route;
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 = 'Foundation\Http\Controllers';
18
19
    /**
20
     * Define your route model bindings, pattern filters, etc.
21
     *
22
     * @return void
23
     */
24 4
    public function boot()
25
    {
26 4
        parent::boot();
27 4
    }
28
29 4
    public function register()
30
    {
31 4
        $this->map();
32 4
        parent::register();
33 4
    }
34
35
    /**
36
     * Define the routes for the application.
37
     *
38
     * @return void
39
     */
40 4
    public function map()
41
    {
42 4
        $this->mapApiRoutes();
43 4
    }
44
45
    /**
46
     * Define the "web" routes for the application.
47
     *
48
     * These routes all receive session state, CSRF protection, etc.
49
     *
50
     * @return void
51
     */
52
    protected function mapWebRoutes()
53
    {
54
        Route::middleware('web')
55
            ->namespace($this->namespace)
56
            ->group(base_path('routes/web.php'));
57
    }
58
59
    /**
60
     * Define the "api" routes for the application.
61
     *
62
     * These routes are typically stateless.
63
     *
64
     * @return void
65
     */
66 4
    protected function mapApiRoutes()
67
    {
68 4
        $path = base_path('src/Foundation/Routes/api.php');
69 4
        Route::middleware('api:noauth')
70 4
            ->namespace($this->namespace)
71 4
            ->group($path);
72 4
    }
73
}
74