Completed
Push — master ( 47438c...afb949 )
by ARCANEDEV
09:00
created

RouteServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 38
ccs 13
cts 13
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A map() 0 4 1
A mapAdminRoutes() 0 12 1
1
<?php namespace Arcanesoft\Media\Providers;
2
3
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider;
4
use Arcanesoft\Media\Http\Routes;
5
use Illuminate\Contracts\Routing\Registrar as Router;
6
7
/**
8
 * Class     RouteServiceProvider
9
 *
10
 * @package  Arcanesoft\Media\Providers
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class RouteServiceProvider extends ServiceProvider
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Main Functions
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    /**
20
     * Define the routes for the application.
21
     *
22
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
23
     */
24 8
    public function map(Router $router)
25
    {
26 8
        $this->mapAdminRoutes($router);
27 8
    }
28
29
    /* ------------------------------------------------------------------------------------------------
30
     |  Routes
31
     | ------------------------------------------------------------------------------------------------
32
     */
33
    /**
34
     * Register the admin routes.
35
     *
36
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
37
     */
38 8
    private function mapAdminRoutes(Router $router)
39
    {
40 8
        $attributes = $this->getAdminAttributes(
41 8
            'media.',
42 8
            'Arcanesoft\\Media\\Http\\Controllers\\Admin',
43 8
            $this->config()->get('arcanesoft.media.route.prefix', 'media')
44 4
        );
45
46 8
        $router->group($attributes, function (Router $router) {
47 8
            Routes\Admin\MediaRoutes::register($router);
48 8
        });
49 8
    }
50
}
51