appService = new AppService; parent::__construct(); } protected function configure() { $this->setDescription('Get the WhoAmI information.'); } /** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { $ydb = $this->appService->initYdb(); $result = $ydb->retry(function (Ydb $ydb) use ($output) { $discovery = $ydb->discovery(); return $discovery->whoAmI(); }, true); $output->writeln($result); return Command::SUCCESS; } }