Skip to content

Upgrade to Symfony v5.4 minimum #265

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

Closed
wants to merge 9 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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 @@ -39,6 +37,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
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@
"ext-json": "*",
"doctrine/doctrine-bundle": "^2.4",
"meilisearch/meilisearch-php": "^1.0.0",
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0",
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/polyfill-php80": "^1.27",
"symfony/property-access": "^4.4 || ^5.0 || ^6.0",
"symfony/serializer": "^4.4 || ^5.0 || ^6.0"
"symfony/property-access": "^5.4 || ^6.0",
"symfony/serializer": "^5.4 || ^6.0"
"symfony/filesystem": "^4.4 || ^5.0 || ^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
14 changes: 8 additions & 6 deletions src/Command/MeilisearchClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@

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;

final class MeilisearchClearCommand extends IndexCommand
{
protected static $defaultName = 'meilisearch:clear|meili:clear';
protected static $defaultDescription = 'Clear the index documents';

public static function getDefaultName(): string
{
return 'meilisearch:clear|meili:clear';
return self::$defaultName;
}

public static function getDefaultDescription(): string
{
return 'Clear the index documents';
return self::$defaultDescription;
}
Comment on lines +14 to 25
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this, as there is no point to do this at current time. When we'll be able to provide info via attributes we will.
Same in other commands


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 @@ -51,6 +53,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

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

return 0;
return Command::SUCCESS;
}
}
14 changes: 8 additions & 6 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,6 +20,9 @@ final class MeilisearchCreateCommand extends IndexCommand
{
private Client $searchClient;

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

public function __construct(SearchService $searchService, Client $searchClient)
{
parent::__construct($searchService);
Expand All @@ -28,19 +32,17 @@ public function __construct(SearchService $searchService, Client $searchClient)

public static function getDefaultName(): string
{
return 'meilisearch:create|meili:create';
return self::$defaultName;
}

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

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 +114,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

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

return 0;
return Command::SUCCESS;
}
}
14 changes: 8 additions & 6 deletions src/Command/MeilisearchDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

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;
Expand All @@ -14,19 +15,20 @@ final class MeilisearchDeleteCommand extends IndexCommand
{
public static function getDefaultName(): string
{
return 'meilisearch:delete|meili:delete';
return self::$defaultName;
}

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

protected static $defaultName = 'meilisearch:delete|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 @@ -51,6 +53,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

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

return 0;
return Command::SUCCESS;
}
}
11 changes: 7 additions & 4 deletions src/Command/MeilisearchImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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;
Expand All @@ -21,6 +22,9 @@ final class MeilisearchImportCommand extends IndexCommand
{
private const DEFAULT_RESPONSE_TIMEOUT = 5000;

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

protected Client $searchClient;
protected ManagerRegistry $managerRegistry;

Expand All @@ -34,18 +38,17 @@ public function __construct(SearchService $searchService, ManagerRegistry $manag

public static function getDefaultName(): string
{
return 'meilisearch:import|meili:import';
return self::$defaultName;
}

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

protected function configure(): void
{
$this
->setDescription(self::getDefaultDescription())
->addOption('indices', 'i', InputOption::VALUE_OPTIONAL, 'Comma-separated list of index names')
->addOption(
'update-settings',
Expand Down Expand Up @@ -186,7 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

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

return 0;
return Command::SUCCESS;
}

/**
Expand Down