public function warning($message) { $this->block($message, 'WARNING', 'fg=white;bg=red', ' ', true); }
/** * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $lockHandler = new LockHandler('app:sync.lock'); if (!$lockHandler->lock()) { $io->warning('Sync process already running'); return; } $service = $this->getContainer()->get('app.sync'); switch ($input->getOption('type')) { case 'users': $service->syncUsers(); break; case 'groups': $service->syncGroups(); break; case 'grouphub': $service->syncGrouphubGroups(); break; case 'queue': $service->syncGrouphubGroupsFromQueue(); break; default: $service->sync(); } $io->success('Done!'); }