Module::getModuleDependencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Fabiang\DoctrineDynamic;
6
7
use Laminas\ModuleManager\Feature\ConfigProviderInterface;
8
use Laminas\ModuleManager\Feature\DependencyIndicatorInterface;
9
use Laminas\ModuleManager\Feature\InitProviderInterface;
10
use Laminas\ModuleManager\ModuleManagerInterface;
11
use Laminas\Mvc\Application;
12
use Laminas\Mvc\MvcEvent;
13
14
final class Module implements
15
    ConfigProviderInterface,
16
    DependencyIndicatorInterface,
17
    InitProviderInterface
18
{
19
    /**
20
     * {@inheritDoc}
21
     */
22 1
    public function getConfig(): iterable
23
    {
24 1
        return require __DIR__ . '/../config/module.config.php';
25
    }
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function getModuleDependencies(): array
31
    {
32
        return ['DoctrineORMModule'];
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38 1
    public function init(ModuleManagerInterface $manager): void
39
    {
40 1
        $sharedEventManager = $manager->getEventManager()->getSharedManager();
41 1
        $listener           = new Listener\RegisterProxyDriverListener();
42 1
        $sharedEventManager->attach(
43
            Application::class,
44
            MvcEvent::EVENT_BOOTSTRAP,
45 1
            [$listener, 'onBootstrap']
46
        );
47
    }
48
}
49