| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 | |||
| 38 |