Skip to content

Commit 74dfa0c

Browse files
bors[bot]norkunas
andauthored
Merge #181
181: Support Symfony 6.1 r=brunoocasali a=norkunas # Pull Request ## What does this PR do? Adds Support for Symfony 6.1 with resolved deprecations ## PR checklist Please check if your PR fulfills the following requirements: - [ ] Does this PR fix an existing issue? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Co-authored-by: Tomas <[email protected]>
2 parents 062ba38 + f107f34 commit 74dfa0c

File tree

6 files changed

+47
-11
lines changed

6 files changed

+47
-11
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
sf-version: '6.0.*'
2828
- php-version: '8.1'
2929
sf-version: '6.0.*'
30+
- php-version: '8.1'
31+
sf-version: '6.1.*'
3032
name: integration-tests (PHP ${{ matrix.php-version }})
3133
steps:
3234
- uses: actions/checkout@v3

src/Command/IndexCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ abstract class IndexCommand extends Command
1818
private string $prefix;
1919
protected SearchService $searchService;
2020

21-
public function __construct(SearchService $searchService, ?string $name = null)
21+
public function __construct(SearchService $searchService)
2222
{
2323
$this->searchService = $searchService;
2424
$this->prefix = $this->searchService->getConfiguration()->get('prefix');
2525

26-
parent::__construct($name);
26+
parent::__construct();
2727
}
2828

2929
protected function getIndices(): Collection

src/Command/MeiliSearchClearCommand.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@
1313
*/
1414
final class MeiliSearchClearCommand extends IndexCommand
1515
{
16-
protected static $defaultName = 'meili:clear';
16+
public static function getDefaultName(): string
17+
{
18+
return 'meili:clear';
19+
}
20+
21+
public static function getDefaultDescription(): string
22+
{
23+
return 'Clear the index documents';
24+
}
1725

1826
protected function configure(): void
1927
{
2028
$this
21-
->setDescription('Clear the index documents')
29+
->setDescription(self::getDefaultDescription())
2230
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
2331
}
2432

src/Command/MeiliSearchCreateCommand.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
final class MeiliSearchCreateCommand extends IndexCommand
1717
{
18-
protected static $defaultName = 'meili:create';
19-
2018
private Client $searchClient;
2119

2220
public function __construct(SearchService $searchService, Client $searchClient)
@@ -26,10 +24,20 @@ public function __construct(SearchService $searchService, Client $searchClient)
2624
$this->searchClient = $searchClient;
2725
}
2826

27+
public static function getDefaultName(): string
28+
{
29+
return 'meili:create';
30+
}
31+
32+
public static function getDefaultDescription(): string
33+
{
34+
return 'Create indexes';
35+
}
36+
2937
protected function configure(): void
3038
{
3139
$this
32-
->setDescription('Create indexes')
40+
->setDescription(self::getDefaultDescription())
3341
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
3442
}
3543

src/Command/MeiliSearchDeleteCommand.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,20 @@
1414
*/
1515
final class MeiliSearchDeleteCommand extends IndexCommand
1616
{
17-
protected static $defaultName = 'meili:delete';
17+
public static function getDefaultName(): string
18+
{
19+
return 'meili:delete';
20+
}
21+
22+
public static function getDefaultDescription(): string
23+
{
24+
return 'Delete the indexes';
25+
}
1826

1927
protected function configure(): void
2028
{
2129
$this
22-
->setDescription('Delete the indices')
30+
->setDescription(self::getDefaultDescription())
2331
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
2432
}
2533

src/Command/MeiliSearchImportCommand.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,31 @@ final class MeiliSearchImportCommand extends IndexCommand
2121
{
2222
private const DEFAULT_RESPONSE_TIMEOUT = 5000;
2323

24-
protected static $defaultName = 'meili:import';
2524
protected Client $searchClient;
2625
protected ManagerRegistry $managerRegistry;
2726

2827
public function __construct(SearchService $searchService, ManagerRegistry $managerRegistry, Client $searchClient)
2928
{
3029
parent::__construct($searchService);
30+
3131
$this->managerRegistry = $managerRegistry;
3232
$this->searchClient = $searchClient;
3333
}
3434

35+
public static function getDefaultName(): string
36+
{
37+
return 'meili:import';
38+
}
39+
40+
public static function getDefaultDescription(): string
41+
{
42+
return 'Import given entity into search engine';
43+
}
44+
3545
protected function configure(): void
3646
{
3747
$this
38-
->setDescription('Import given entity into search engine')
48+
->setDescription(self::getDefaultDescription())
3949
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
4050
->addOption(
4151
'update-settings',

0 commit comments

Comments
 (0)