Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 |
||
35 | } |
||
36 | |||
37 | } |
||
38 |