GvEventListenerRegistry::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Gvera\Helpers\bootstrap;
4
5
use Gvera\Events\ThrowableFiredEvent;
6
use Gvera\Events\UserRegisteredEvent;
7
use Gvera\Helpers\dependencyInjection\DIContainer;
8
use Gvera\Helpers\events\EventListenerRegistry;
9
use ReflectionException;
10
11
class GvEventListenerRegistry extends EventListenerRegistry
12
{
13
    /**
14
     * @var DIContainer
15
     */
16
    private DIContainer $container;
17
18
    public function __construct(DIContainer $container)
19
    {
20
        $this->container = $container;
21
    }
22
23
    /**
24
     * @throws ReflectionException
25
     */
26
    public function registerEventListeners()
27
    {
28
        $this->registerEventListener(
29
            ThrowableFiredEvent::THROWABLE_FIRED_EVENT,
30
            $this->container->get('throwableListener')
31
        );
32
33
        $this->registerEventListener(
34
            UserRegisteredEvent::USER_REGISTERED_EVENT,
35
            $this->container->get('userRegisteredEmailListener')
36
        );
37
    }
38
}
39