Skip to content

Commit

Permalink
Leverage new symfony command name and description definition
Browse files Browse the repository at this point in the history
  • Loading branch information
94noni committed Jun 25, 2023
1 parent 5dbe03b commit 8e5edd3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 61 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-symfony": "^1.2.23",
"phpunit/php-code-coverage": "^9.2.26",
"rector/rector": "^0.17.1",
"symfony/doctrine-bridge": "^5.4 || ^6.0",
"symfony/http-client": "^5.4 || ^6.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0",
Expand Down
17 changes: 0 additions & 17 deletions rector.php

This file was deleted.

14 changes: 3 additions & 11 deletions src/Command/MeilisearchClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@
*/
final class MeilisearchClearCommand extends IndexCommand
{
public static function getDefaultName(): string
{
return 'meili:clear';
}

public static function getDefaultDescription(): string
{
return 'Clear the index documents';
}
protected static $defaultName = 'meili:clear';
protected static $defaultDescription = 'Clear the index documents';

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

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
16 changes: 4 additions & 12 deletions src/Command/MeilisearchCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,19 @@ final class MeilisearchCreateCommand extends IndexCommand
{
private Client $searchClient;

protected static $defaultName = 'meili:create';
protected static $defaultDescription = 'Create indexes';

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

$this->searchClient = $searchClient;
}

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

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

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

private function entitiesToIndex($indexes): array
Expand Down
13 changes: 3 additions & 10 deletions src/Command/MeilisearchDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@
*/
final class MeilisearchDeleteCommand extends IndexCommand
{
public static function getDefaultName(): string
{
return 'meili:delete';
}

public static function getDefaultDescription(): string
{
return 'Delete the indexes';
}
protected static $defaultName = 'meili:delete';
protected static $defaultDescription = 'Delete the indexes';

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

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
13 changes: 3 additions & 10 deletions src/Command/MeilisearchImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ final class MeilisearchImportCommand extends IndexCommand
{
private const DEFAULT_RESPONSE_TIMEOUT = 5000;

protected static $defaultName = 'meili:import';
protected static $defaultDescription = 'Import given entity into search engine';

protected Client $searchClient;
protected ManagerRegistry $managerRegistry;

Expand All @@ -36,16 +39,6 @@ public function __construct(SearchService $searchService, ManagerRegistry $manag
$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
Expand Down

0 comments on commit 8e5edd3

Please sign in to comment.