MissingViewHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleMissingView() 0 14 1
1
<?php
2
3
namespace Knp\RadBundle\EventListener;
4
5
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
6
use Symfony\Component\HttpKernel\HttpKernelInterface;
7
8
class MissingViewHandler
9
{
10
    public function handleMissingView(GetResponseEvent $event, $viewName, array $viewParams = null)
11
    {
12
        $kernel = $event->getKernel();
13
        $request = $event->getRequest();
14
15
        $subRequest = $request->duplicate(array(), null, array(
16
            '_controller' => 'KnpRadBundle:Assistant:missingView',
17
            'viewName'   => $viewName,
18
            'viewParams' => $viewParams,
19
        ));
20
21
        $response = $kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
22
        $event->setResponse($response);
23
    }
24
}
25