Completed
Push — master ( e6f9e9...ade0a3 )
by Peter
03:33
created

ExceptionListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A onKernelException() 0 7 2
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2014, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
namespace AnimeDb\Bundle\CacheTimeKeeperBundle\Event\Listener;
10
11
use AnimeDb\Bundle\CacheTimeKeeperBundle\Exception\NotModifiedException;
12
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
13
14
class ExceptionListener
15
{
16
    /**
17
     * @param GetResponseForExceptionEvent $event
18
     */
19 2
    public function onKernelException(GetResponseForExceptionEvent $event)
20
    {
21 2
        $exception = $event->getException();
22 2
        if ($exception instanceof NotModifiedException) {
23 1
            $event->setResponse($exception->getResponse());
24 1
        }
25 2
    }
26
}
27