protected function registerConsolablePack(ServiceProviderInterface $provider) { if ($provider instanceof ConsolablePackInterface) { $self = $this; $this['dispatcher']->addListener(ConsoleEvents::INIT, function (ConsoleEvent $event) use($self, $provider) { $console = $event->getConsole(); foreach ($provider->getConsoleCommands($self) as $command) { $console->add($command); } }); } }