* @license MIT */ class Module implements BootstrapListenerInterface, ConfigProviderInterface { /** * {@inheritDoc} */ public function onBootstrap(EventInterface $event) { /* @var Application $application */ $application = $event->getTarget(); $serviceManager = $application->getServiceManager(); $eventManager = $application->getEventManager(); /* @var GuardInterface[]|array $guards */ $guards = $serviceManager->get('LmcRbacMvc\Guards'); // Register listeners, if any foreach ($guards as $guard) { $guard->attach($eventManager); } } /** * {@inheritDoc} */ public function getConfig() { return include __DIR__ . '/../config/module.config.php'; } }