Skip to content
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

Upgrade to Symfony v5.4 minimum #265

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
include:
- php-version: '7.4'
sf-version: '4.4.*'
- php-version: '7.4'
sf-version: '5.4.*'
- php-version: '8.0'
Expand All @@ -31,6 +29,8 @@ jobs:
sf-version: '6.1.*'
- php-version: '8.2'
sf-version: '6.2.*'
- php-version: '8.2'
sf-version: '6.3.*'

name: integration-tests (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }})
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Say goodbye to server deployment and manual updates with [Meilisearch Cloud](htt
## 📝 Requirements

* **Require** PHP 7.4 and later.
* **Compatible** with Symfony 4.0 and later.
* **Compatible** with Symfony 5.4 and later.
* **Support** Doctrine ORM and Doctrine MongoDB.

## 🤖 Compatibility with Meilisearch
Expand Down
1 change: 1 addition & 0 deletions bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ status = [
'integration-tests (PHP 8.0) (Symfony 6.0.*)',
'integration-tests (PHP 8.1) (Symfony 6.1.*)',
'integration-tests (PHP 8.2) (Symfony 6.2.*)',
'integration-tests (PHP 8.2) (Symfony 6.3.*)',
'Code style'
]
# 1 hour timeout
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@
"ext-json": "*",
"doctrine/doctrine-bundle": "^2.4",
"meilisearch/meilisearch-php": "^1.0.0",
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0",
"symfony/property-access": "^4.4 || ^5.0 || ^6.0",
"symfony/serializer": "^4.4 || ^5.0 || ^6.0"
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/property-access": "^5.4 || ^6.0",
"symfony/serializer": "^5.4 || ^6.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
"doctrine/orm": "^2.9",
"phpmd/phpmd": "^2.13",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"nyholm/psr7": "^1.5.1",
"php-cs-fixer/shim": "^3.14",
"phpmd/phpmd": "^2.13",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.6",
"phpstan/phpstan-doctrine": "^1.3.33",
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-symfony": "^1.2.23",
"phpunit/php-code-coverage": "^9.2.26",
"symfony/doctrine-bridge": "^4.4 || ^5.0 || ^6.0",
"symfony/http-client": "^4.4 || ^5.0 || ^6.0",
"symfony/phpunit-bridge": "^4.4 || ^5.0 || ^6.0",
"symfony/yaml": "^4.4 || ^5.0 || ^6.0"
"symfony/doctrine-bridge": "^5.4 || ^6.0",
"symfony/http-client": "^5.4 || ^6.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/IndexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\Console\Output\OutputInterface;

/**
* Class IndexCommand.
* Base command class all commands extends.
*/
abstract class IndexCommand extends Command
{
Expand Down
21 changes: 5 additions & 16 deletions src/Command/MeilisearchClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,19 @@

namespace Meilisearch\Bundle\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Class MeilisearchClearCommand.
*/
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
->setDescription(self::getDefaultDescription())
->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 All @@ -54,6 +43,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$output->writeln('<info>Done!</info>');

return 0;
return Command::SUCCESS;
}
}
20 changes: 6 additions & 14 deletions src/Command/MeilisearchCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Meilisearch\Bundle\SearchService;
use Meilisearch\Bundle\SettingsProvider;
use Meilisearch\Client;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -19,28 +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
->setDescription(self::getDefaultDescription())
->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 Expand Up @@ -112,6 +104,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$output->writeln('<info>Done!</info>');

return 0;
return Command::SUCCESS;
}
}
21 changes: 5 additions & 16 deletions src/Command/MeilisearchDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,19 @@

use Meilisearch\Bundle\Collection;
use Meilisearch\Exceptions\ApiException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Class MeilisearchDeleteCommand.
*/
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
->setDescription(self::getDefaultDescription())
->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 All @@ -54,6 +43,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$output->writeln('<info>Done!</info>');

return 0;
return Command::SUCCESS;
}
}
20 changes: 5 additions & 15 deletions src/Command/MeilisearchImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
use Meilisearch\Bundle\SettingsProvider;
use Meilisearch\Client;
use Meilisearch\Exceptions\TimeOutException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Class MeilisearchImportCommand.
*/
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 @@ -35,20 +36,9 @@ 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
->setDescription(self::getDefaultDescription())
94noni marked this conversation as resolved.
Show resolved Hide resolved
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
->addOption(
'update-settings',
Expand Down Expand Up @@ -189,7 +179,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$output->writeln('<info>Done!</info>');

return 0;
return Command::SUCCESS;
}

/**
Expand Down