Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions core/Command/SnowflakeDecodeId.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,31 @@
*/
namespace OC\Core\Command;

use OC\Snowflake\Decoder;
use OCP\Snowflake\IDecoder;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class SnowflakeDecodeId extends Base {
public function __construct(
private readonly IDecoder $decoder,
) {
parent::__construct();
}

protected function configure(): void {
parent::configure();

$this
->setName('decode-snowflake')
->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 = (new Decoder)->decode($snowflakeId);
$data = $this->decoder->decode($snowflakeId);

$rows = [
['Snowflake ID', $snowflakeId],
Expand Down
Loading