Skip to content

Commit 485feef

Browse files
committed
fix(command): add attributes support
1 parent 6868622 commit 485feef

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Command/CreateCommand.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
namespace ACSEO\TypesenseBundle\Command;
66

77
use ACSEO\TypesenseBundle\Manager\CollectionManager;
8+
use Symfony\Component\Console\Attribute\AsCommand;
89
use Symfony\Component\Console\Command\Command;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Output\OutputInterface;
1112

13+
#[AsCommand(
14+
name: 'typesense:create',
15+
)]
1216
class CreateCommand extends Command
1317
{
14-
protected static $defaultName = 'typesense:create';
1518
private $collectionManager;
1619

1720
public function __construct(CollectionManager $collectionManager)

src/Command/ImportCommand.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
use ACSEO\TypesenseBundle\Manager\DocumentManager;
99
use ACSEO\TypesenseBundle\Transformer\DoctrineToTypesenseTransformer;
1010
use Doctrine\ORM\EntityManagerInterface;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112
use Symfony\Component\Console\Command\Command;
1213
use Symfony\Component\Console\Input\InputInterface;
1314
use Symfony\Component\Console\Input\InputOption;
1415
use Symfony\Component\Console\Output\OutputInterface;
1516
use Symfony\Component\Console\Style\SymfonyStyle;
1617

18+
#[AsCommand(
19+
name: 'typesense:import',
20+
)]
1721
class ImportCommand extends Command
1822
{
19-
protected static $defaultName = 'typesense:import';
20-
2123
private $em;
2224
private $collectionManager;
2325
private $documentManager;

0 commit comments

Comments
 (0)