Merge pull request #56083 from nextcloud/fix/snowflakeids

This commit is contained in:
Benjamin Gaussorgues 2025-11-04 15:59:21 +01:00 committed by GitHub
commit d92b02a14a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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],