RouteServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 8

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerRouteBindings() 0 6 1
A map() 0 6 1
A mapAdminRoutes() 0 12 1
1
<?php namespace Arcanesoft\Blog\Providers;
2
3
use Arcanesoft\Blog\Http\Routes;
4
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider;
5
6
/**
7
 * Class     RouteServiceProvider
8
 *
9
 * @package  Arcanesoft\Blog\Providers
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class RouteServiceProvider extends ServiceProvider
13
{
14
    /* -----------------------------------------------------------------
15
     |  Properties
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * The admin controller namespace for the application.
21
     *
22
     * @var string
23
     */
24
    protected $adminNamespace = 'Arcanesoft\\Blog\\Http\\Controllers\\Admin';
25
26
    /* -----------------------------------------------------------------
27
     |  Main Methods
28
     | -----------------------------------------------------------------
29
     */
30
31
    /**
32
     * Register the route bindings.
33
     */
34 102
    protected function registerRouteBindings()
35
    {
36 102
        Routes\Admin\PostsRoutes::bindings();
37 102
        Routes\Admin\CategoriesRoutes::bindings();
38 102
        Routes\Admin\TagsRoutes::bindings();
39 102
    }
40
41
    /**
42
     * Define the routes for the application.
43
     */
44
    public function map()
45
    {
46 102
        $this->adminGroup(function () {
47 102
            $this->mapAdminRoutes();
48 102
        });
49 102
    }
50
51
    /**
52
     * Define the admin routes for the application.
53
     */
54 102
    private function mapAdminRoutes()
55
    {
56 102
        $this->name('blog.')
57 102
             ->prefix($this->config()->get('arcanesoft.blog.route.prefix', 'blog'))
58 102
             ->group(function () {
59 102
                 Routes\Admin\StatsRoutes::register();
60 102
                 Routes\Admin\PostsRoutes::register();
61 102
                 Routes\Admin\CommentsRoutes::register();
62 102
                 Routes\Admin\CategoriesRoutes::register();
63 102
                 Routes\Admin\TagsRoutes::register();
64 102
            });
65 102
    }
66
}
67