/** * Loads bundle's events into application's event dispatcher. * * @param Config $config * @param callable|null $recipe */ private function loadEvents(Config $config, callable $recipe = null) { if (false === $this->runRecipe($config, $recipe)) { $events = $config->getRawSection('events'); if (true === is_array($events) || 0 < count($events)) { $this->application->getEventDispatcher()->addListeners($events); } } }