RouteServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 7
Bugs 0 Features 6
Metric Value
wmc 1
c 7
b 0
f 6
lcom 0
cbo 2
dl 0
loc 44
rs 10
ccs 21
cts 21
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B connect() 0 34 1
1
<?php
2
3
namespace OpenTribes\Core\Silex\Provider;
4
5
6
use OpenTribes\Core\Silex\Controller;
7
use Silex\Application;
8
use Silex\ControllerCollection;
9
use Silex\ControllerProviderInterface;
10
11
class RouteServiceProvider implements ControllerProviderInterface{
12
    /**
13
     * Returns routes to connect to the given application.
14
     *
15
     * @param Application $app An Application instance
16
     *
17
     * @return ControllerCollection A ControllerCollection instance
18
     */
19 35
    public function connect(Application $app)
20
    {
21
        /**
22
         * @var ControllerCollection $collection
23
         */
24 35
        $collection = $app['controllers_factory'];
25
        $collection
26 35
            ->match('/', Controller::INDEX . ':indexAction')
27 35
            ->method('GET')
28 35
            ->value('template', 'pages/landing');
29
        $collection
30 35
            ->match('/account/login', Controller::INDEX . ':indexAction')
31 35
            ->method('POST')
32 35
            ->value('template', 'pages/landing');
33
        $collection
34 35
            ->match('/account/create', Controller::ACCOUNT . ':indexAction')
35 35
            ->method('POST|GET')
36 35
            ->value('template', 'pages/registration');
37
        $collection
38 35
            ->match('/game', Controller::INDEX . ':indexAction')
39 35
            ->method('GET')
40 35
            ->value('template', 'pages/landing');
41
        $collection
42 35
            ->match('/cities',Controller::CITY.':listAction')
43 35
            ->method('GET')
44 35
            ->value('template','pages/game/cityList');
45
        $collection
46 35
            ->match('/city/create',Controller::CITY.':createAction')
47 35
            ->method('GET')
48 35
            ->value('template','pages/game/newcity');
49
50
51 35
        return $collection;
52
    }
53
54
}