Completed
Push — master ( a78262...4e959e )
by Roni
11:36
created

DoctrineDeleteEventLogger::__construct()   A

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
/*
4
 * This file is part of the XiideaEasyAuditBundle package.
5
 *
6
 * (c) Xiidea <http://www.xiidea.net>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Xiidea\EasyAuditBundle\Subscriber;
13
14
15
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
16
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
17
use Symfony\Component\HttpKernel\KernelEvents;
18
use Xiidea\EasyAuditBundle\Logger\Logger;
19
20
class DoctrineDeleteEventLogger implements EventSubscriberInterface
21
{
22
    /**
23
     * @var Logger
24
     */
25
    private $logger;
26
27
    /**
28
     * DoctrineDeleteEventLogger constructor.
29
     * @param Logger $logger
30
     */
31
    public function __construct(Logger $logger)
32
    {
33
        $this->logger = $logger;
34
    }
35
36
    public function onKernelResponse(FilterResponseEvent $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
    {
38
        $this->logger->savePendingLogs();
39
    }
40
41
    public static function getSubscribedEvents()
42
    {
43
        return [
44
            KernelEvents::RESPONSE => 'onKernelResponse'
45
        ];
46
    }
47
}