Skip to content

Support Symfony 6.1 #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
sf-version: '6.0.*'
- php-version: '8.1'
sf-version: '6.0.*'
- php-version: '8.1'
sf-version: '6.1.*'
name: integration-tests (PHP ${{ matrix.php-version }})
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions src/Command/IndexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ abstract class IndexCommand extends Command
private string $prefix;
protected SearchService $searchService;

public function __construct(SearchService $searchService, ?string $name = null)
public function __construct(SearchService $searchService)
{
$this->searchService = $searchService;
$this->prefix = $this->searchService->getConfiguration()->get('prefix');

parent::__construct($name);
parent::__construct();
}

protected function getIndices(): Collection
Expand Down
12 changes: 10 additions & 2 deletions src/Command/MeiliSearchClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@
*/
final class MeiliSearchClearCommand extends IndexCommand
{
protected static $defaultName = 'meili:clear';
public static function getDefaultName(): string
{
return 'meili:clear';
}

public static function getDefaultDescription(): string
{
return 'Clear the index documents';
}

protected function configure(): void
{
$this
->setDescription('Clear the index documents')
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
}

Expand Down
14 changes: 11 additions & 3 deletions src/Command/MeiliSearchCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

final class MeiliSearchCreateCommand extends IndexCommand
{
protected static $defaultName = 'meili:create';

private Client $searchClient;

public function __construct(SearchService $searchService, Client $searchClient)
Expand All @@ -26,10 +24,20 @@ public function __construct(SearchService $searchService, Client $searchClient)
$this->searchClient = $searchClient;
}

public static function getDefaultName(): string
{
return 'meili:create';
}

public static function getDefaultDescription(): string
{
return 'Create indexes';
}

protected function configure(): void
{
$this
->setDescription('Create indexes')
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
}

Expand Down
12 changes: 10 additions & 2 deletions src/Command/MeiliSearchDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@
*/
final class MeiliSearchDeleteCommand extends IndexCommand
{
protected static $defaultName = 'meili:delete';
public static function getDefaultName(): string
{
return 'meili:delete';
}

public static function getDefaultDescription(): string
{
return 'Delete the indexes';
}

protected function configure(): void
{
$this
->setDescription('Delete the indices')
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names');
}

Expand Down
14 changes: 12 additions & 2 deletions src/Command/MeiliSearchImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,31 @@ final class MeiliSearchImportCommand extends IndexCommand
{
private const DEFAULT_RESPONSE_TIMEOUT = 5000;

protected static $defaultName = 'meili:import';
protected Client $searchClient;
protected ManagerRegistry $managerRegistry;

public function __construct(SearchService $searchService, ManagerRegistry $managerRegistry, Client $searchClient)
{
parent::__construct($searchService);

$this->managerRegistry = $managerRegistry;
$this->searchClient = $searchClient;
}

public static function getDefaultName(): string
{
return 'meili:import';
}

public static function getDefaultDescription(): string
{
return 'Import given entity into search engine';
}

protected function configure(): void
{
$this
->setDescription('Import given entity into search engine')
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
->addOption(
'update-settings',
Expand Down