Response::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Knp\RadBundle\Controller\Helper;
4
5
use Symfony\Component\Routing\RouterInterface;
6
use Symfony\Component\HttpFoundation\RedirectResponse;
7
8
class Response
9
{
10
    private $router;
11
12
    public function __construct(RouterInterface $router)
13
    {
14
        $this->router = $router;
15
    }
16
17
    public function redirectToRoute($route, array $parameters = array(), $status = 302)
18
    {
19
        return new RedirectResponse($this->router->generate($route, $parameters), $status);
20
    }
21
}
22