TestDummyController   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 6
lcom 2
cbo 2

6 Methods

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 3 1
A testAction() 0 4 1
A genericExceptionAction() 0 4 1
A defaultAction() 0 6 1
A arrayAction() 0 5 1
A otherViewAction() 0 7 1
1
<?php
2
3
namespace Vectorface\SnappyRouterTests\Controller;
4
5
use \Exception;
6
use Vectorface\SnappyRouter\Controller\AbstractController;
7
use Vectorface\SnappyRouter\Exception\InternalErrorException;
8
9
/**
10
 * A test controller for testing the router.
11
 * @copyright Copyright (c) 2014, VectorFace, Inc.
12
 * @author Dan Bruce <[email protected]>
13
 */
14
class TestDummyController extends AbstractController
15
{
16
17
    public function indexAction()
18
    {
19
    }
20
21
    public function testAction()
22
    {
23
        return 'This is a test service.';
24
    }
25
26
    public function genericExceptionAction()
27
    {
28
        throw new InternalErrorException('A generic exception.');
29
    }
30
31
    public function defaultAction()
32
    {
33
        // ensure some abstract methods work
34
        $this->set('request', $this->getRequest());
35
        $this->get('request');
36
    }
37
38
    public function arrayAction()
39
    {
40
        $this->viewContext['variable'] = 'broken';
41
        return array('variable' => 'test');
42
    }
43
44
    public function otherViewAction()
45
    {
46
        return $this->renderView(
47
            array('variable' => 'test'),
48
            'test/array.twig'
49
        );
50
    }
51
}
52