Passed
Pull Request — master (#1)
by one
07:55
created

ExceptionSubscriber::getSubscribedEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * (c) Lukasz D. Tulikowski <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace App\EventSubscriber;
13
14
use Symfony\Component\EventDispatcher\EventDispatcher;
15
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
16
use Symfony\Component\HttpKernel\KernelEvents;
17
18
class ExceptionSubscriber implements EventSubscriberInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public static function getSubscribedEvents()
24
    {
25
        // return the subscribed events, their methods and priorities
26
        return [
27
            KernelEvents::EXCEPTION => [
28
                ['processException', 10],
29
            ],
30
        ];
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 11
    public function processException()
37
    {
38 11
        $dispatcher = new EventDispatcher();
39 11
        $dispatcher->dispatch('onKernelRequest');
40 11
    }
41
}
42