RouteServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 28
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A map() 0 4 1
A registerApiMiddleware() 0 9 2
1
<?php namespace Arcanedev\LaravelApiHelper\Providers;
2
3
use Arcanedev\Support\Providers\RouteServiceProvider as ServiceProvider;
4
5
/**
6
 * Class     RouteServiceProvider
7
 *
8
 * @package  Arcanedev\LaravelApiHelper\Providers
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class RouteServiceProvider extends ServiceProvider
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Define the routes for the application.
20
     */
21 84
    public function map()
22
    {
23 84
        $this->registerApiMiddleware();
24 84
    }
25
26
    /**
27
     * Register the API route Middleware.
28
     */
29 84
    private function registerApiMiddleware()
30
    {
31
        /** @var  \Illuminate\Contracts\Config\Repository  $config */
32 84
        $config = $this->app['config'];
33
34 84
        foreach ($config->get('api-helper.middleware', []) as $name => $class) {
35 84
            $this->aliasMiddleware($name, $class);
36
        };
37 84
    }
38
}
39