Passed
Push — master ( d1c5a6...bac8bf )
by Fabian
03:36 queued 12s
created

Module::getConfig()   A

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
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Fabiang\AsseticBundle;
6
7
use Laminas\EventManager\EventInterface;
8
use Laminas\ModuleManager\Feature\BootstrapListenerInterface;
9
use Laminas\ModuleManager\Feature\ConfigProviderInterface;
10
use Laminas\Mvc\MvcEvent;
11
12
class Module implements ConfigProviderInterface, BootstrapListenerInterface
13
{
14
15
    /**
16
     * Listen to the bootstrap event
17
     */
18
    public function onBootstrap(EventInterface $e): void
19
    {
20
        /** @var MvcEvent $e */
21
        // Only attach the Listener if the request came in through http(s)
22
        if (PHP_SAPI !== 'cli') {
23
            $app = $e->getApplication();
24
25
            $app->getServiceManager()->get(Listener::class)->attach($app->getEventManager());
26
        }
27
    }
28
29
    /**
30
     * Returns configuration to merge with application configuration
31
     */
32
    public function getConfig(): iterable
33
    {
34
        return require __DIR__ . '/../config/module.config.php';
35
    }
36
37
}
38