Completed
Push — master ( 45c651...8bfbde )
by Damien
02:27
created

LayersDebugController::layersDebug()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 6

Duplication

Lines 15
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 15
loc 15
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
/**
3
 * Veto.
4
 * PHP Microframework.
5
 *
6
 * @author Damien Walsh <[email protected]>
7
 * @copyright Damien Walsh 2013-2014
8
 * @version 0.1
9
 * @package veto
10
 */
11
namespace Veto\Debug\Controller;
12
13
use Veto\HTTP\Response;
14
use Veto\MVC\AbstractController;
15
16
/**
17
 * ListenersDebugController
18
 *
19
 * Controller to render a debug dump of the registered layers in the application.
20
 */
21 View Code Duplication
class LayersDebugController extends AbstractController
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...
22
{
23
    /**
24
     * @return Response
25
     */
26
    public function layersDebug()
27
    {
28
        // The templates for showing exceptions are outside of the normal application
29
        // template path. It is therefore necessary to specify the path here.
30
        $this->get('php_template_engine')->addPath(
31
            __DIR__ . '/../Resources/LayersDebug'
32
        );
33
34
        // Render the template
35
        $response = $this->get('php_template_engine')->render('List.html.php', array(
36
            'layerPriorityGroups' => $this->container->get('chain')->getLayers()
37
        ));
38
39
        return new Response($response);
40
    }
41
}
42