LogEventsListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 10
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A resolveEventHandler() 0 4 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\Listener;
13
14
use Symfony\Contracts\EventDispatcher\Event;
15
use Xiidea\EasyAuditBundle\Logger\LoggerFactory;
16
use Xiidea\EasyAuditBundle\Resolver\EventResolverFactory;
17
18
class LogEventsListener
19
{
20
    public function __construct(private LoggerFactory $loggerFactory, private EventResolverFactory $resolverFactory)
21
    {
22
    }
23
24
    public function resolveEventHandler(Event $event, $eventName)
25
    {
26
        $eventInfo = $this->resolverFactory->getEventLog($event, $eventName);
27
        $this->loggerFactory->executeLoggers($eventInfo);
28
    }
29
}
30