Completed
Push — master ( 906f5a...709e36 )
by Phecho
03:29
created

ProjectsRoutes::map()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 16

Duplication

Lines 25
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 25
loc 25
rs 8.8571
cc 1
eloc 16
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 * 
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Http\Routes;
13
14
use Illuminate\Contracts\Routing\Registrar;
15
16
/**
17
 * This is the projects routes class.
18
 */
19 View Code Duplication
class ProjectsRoutes
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21
    /**
22
     * Define the projects routes.
23
     *
24
     * @param \Illuminate\Contracts\Routing\Registrar $router
25
     */
26
    public function map(Registrar $router)
27
    {
28
        $router->group([
29
            'middleware' => ['app.hasSetting'],
30
            'setting'    => 'app_name',
31
            'prefix'     => 'projects',
32
            'as'         => 'projects.',
33
        ], function ($router) {
34
            $router->get('/', [
35
                'as'   => 'index',
36
                'uses' => 'ProjectsController@index',
37
            ]);
38
            $router->get('new', [
39
                'as'    => 'new',
40
                'uses'  => 'ProjectsController@new',
41
            ]);
42
43
            $router->post('create', [
44
                'as'    => 'create',
45
                'uses'  => 'ProjectsController@create',
46
            ]);
47
48
            
49
        });
50
    }
51
}
52