Skip to content

Commit d92b02a

Browse files
authored
Merge pull request #56083 from nextcloud/fix/snowflakeids
2 parents 6911a33 + 231b7f8 commit d92b02a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/Command/SnowflakeDecodeId.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@
88
*/
99
namespace OC\Core\Command;
1010

11-
use OC\Snowflake\Decoder;
11+
use OCP\Snowflake\IDecoder;
1212
use Symfony\Component\Console\Helper\Table;
1313
use Symfony\Component\Console\Input\InputArgument;
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616

1717
class SnowflakeDecodeId extends Base {
18+
public function __construct(
19+
private readonly IDecoder $decoder,
20+
) {
21+
parent::__construct();
22+
}
23+
1824
protected function configure(): void {
1925
parent::configure();
2026

2127
$this
22-
->setName('decode-snowflake')
28+
->setName('snowflake:decode')
2329
->setDescription('Decode Snowflake IDs used by Nextcloud')
2430
->addArgument('snowflake-id', InputArgument::REQUIRED, 'Nextcloud Snowflake ID to decode');
2531
}
2632

2733
protected function execute(InputInterface $input, OutputInterface $output): int {
2834
$snowflakeId = $input->getArgument('snowflake-id');
29-
$data = (new Decoder)->decode($snowflakeId);
35+
$data = $this->decoder->decode($snowflakeId);
3036

3137
$rows = [
3238
['Snowflake ID', $snowflakeId],

0 commit comments

Comments
 (0)