From 231b7f8c41e6c80f05a106cc93aef402d9639a92 Mon Sep 17 00:00:00 2001 From: Benjamin Gaussorgues Date: Wed, 29 Oct 2025 17:28:54 +0100 Subject: [PATCH] chore(snowflakes): small fixes on decode command Signed-off-by: Benjamin Gaussorgues --- core/Command/SnowflakeDecodeId.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/Command/SnowflakeDecodeId.php b/core/Command/SnowflakeDecodeId.php index 3626046247b..3ce7c038ff7 100644 --- a/core/Command/SnowflakeDecodeId.php +++ b/core/Command/SnowflakeDecodeId.php @@ -8,25 +8,31 @@ declare(strict_types=1); */ 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],