setName('snowflake:decode') ->setDescription('Decode Snowflake IDs used by Nextcloud') ->addArgument('snowflake-id', InputArgument::REQUIRED, 'Nextcloud Snowflake ID to decode'); } protected function execute(InputInterface $input, OutputInterface $output): int { $snowflakeId = $input->getArgument('snowflake-id'); $data = $this->decoder->decode($snowflakeId); $rows = [ ['Snowflake ID', $snowflakeId], ['Seconds', $data->getSeconds()], ['Milliseconds', $data->getMilliseconds()], ['Created from CLI', $data->isCli() ? 'yes' : 'no'], ['Server ID', $data->getServerId()], ['Sequence ID', $data->getSequenceId()], ['Creation timestamp', $data->getCreatedAt()->format('U.v')], ['Creation date', $data->getCreatedAt()->format('Y-m-d H:i:s.v')], ]; $table = new Table($output); $table->setRows($rows); $table->render(); return Base::SUCCESS; } }