TestController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 18 2
1
<?php
2
3
namespace Behat\Sf2DemoBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
9
class TestController extends Controller
10
{
11
    public function indexAction(Request $request)
12
    {
13
        $type = $request->get('type') ?: 'stranger';
14
15
        return new Response(<<<RESPONSE
16
<html>
17
    <body>
18
        <h1>Hello, {$type}</h1>
19
20
        You are?:
21
        <a href="?type=human">Human</a>
22
        <a href="?type=orc">Orc</a>
23
        <a href="?type=elf">Elf</a>
24
    </body>
25
</html>
26
RESPONSE
27
        );
28
    }
29
}
30