diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65bbbbf..288e6eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,12 @@ jobs: fail-fast: false matrix: php: ['8.2', '8.3', '8.4', '8.5'] - symfony: ['^7.0'] + symfony: ['^7.0', '^8.0'] + exclude: + - php: '8.2' + symfony: '^8.0' + - php: '8.3' + symfony: '^8.0' name: PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }} @@ -55,5 +60,5 @@ jobs: COMPOSER_PROCESS_TIMEOUT: 900 ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} - ALGOLIA_PREFIX: sf_phpunit_${{ matrix.php }}_ + ALGOLIA_PREFIX: sf_phpunit_${{ matrix.php }}_${{ matrix.symfony }}_ run: composer test:unit diff --git a/README.md b/README.md index e1136fe..f982b14 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@
-
+
@@ -31,11 +31,11 @@
## ✨ Features
* **Simple**: You can get started with only 5 lines of YAML
- * **Robust**: It benefits from all the new features of our PHP Client v2, like the [`wait()`](/doc/api-reference/api-methods/wait-task/) method
+ * **Robust**: It benefits from all the features of our PHP Client v3, like the [`wait()`](/doc/api-reference/api-methods/wait-task/) method
* **Flexible**: All methods take optional `$requestOptions` to let you handle your data as you wish
* **Dev-friendly**: Auto-completion and type-hinting thanks to an exhaustive documentation
-Algolia SearchBundle supports PHP > 7.1
+Algolia SearchBundle requires PHP >= 8.2 and supports Symfony 7 and 8.
## 💡 Getting Started
@@ -103,9 +103,7 @@ to get matching results and then will create a doctrine collection. The data are
pulled from the database (that's why you need to pass the Doctrine Manager).
```php
-$em = $this->getDoctrine()->getManagerForClass(Post::class);
-
-$posts = $this->searchService->search($em, Post::class, 'query');
+$posts = $this->searchService->search($entityManager, Post::class, 'query');
```
For full documentation, visit the **[Algolia Symfony Search Bundle](https://www.algolia.com/doc/framework-integration/symfony/getting-started/)**.
@@ -120,4 +118,4 @@ If you want to contribute to this project without installing all its dependencie
## 📄 License
-Algolia Symfony Search Bundle is an open-sourced software licensed under the [MIT license](LICENSE.md).
+Algolia Symfony Search Bundle is an open-sourced software licensed under the [MIT license](LICENSE).
diff --git a/composer.json b/composer.json
index 7f03425..4281f46 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,6 @@
{
"name": "algolia/search-bundle",
+ "description": "Algolia Search integration for Symfony",
"type": "symfony-bundle",
"license": "MIT",
"authors": [
@@ -13,11 +14,10 @@
"php": ">= 8.2",
"algolia/algoliasearch-client-php": "^3.0",
"doctrine/event-manager": "^1.1 || ^2.0",
- "doctrine/persistence": "^2.1 || ^3.0",
- "symfony/filesystem": "^7.0",
- "symfony/http-kernel": "^7.0",
- "symfony/property-access": "^7.0",
- "symfony/serializer": "^7.0"
+ "doctrine/persistence": "^2.1 || ^3.0 || ^4.0",
+ "symfony/filesystem": "^7.0 || ^8.0",
+ "symfony/property-access": "^7.0 || ^8.0",
+ "symfony/serializer": "^7.0 || ^8.0"
},
"autoload": {
"psr-4": {
@@ -34,17 +34,15 @@
},
"require-dev": {
"ext-json": "*",
- "doctrine/doctrine-bundle": "^2.12",
- "doctrine/orm": "^2.5",
+ "doctrine/doctrine-bundle": "^2.12 || ^3.0",
+ "doctrine/orm": "^2.5 || ^3.0",
"friendsofphp/php-cs-fixer": "^v3.54.0",
"jms/serializer-bundle": "^5.4.0",
- "friendsofphp/proxy-manager-lts": "*",
"phpunit/phpunit": "^8.5 || ^9.0",
"roave/security-advisories": "dev-master",
- "symfony/framework-bundle": "^7.0",
- "symfony/phpunit-bridge": "^7.0",
- "symfony/proxy-manager-bridge": "*",
- "symfony/yaml": "^7.0"
+ "symfony/framework-bundle": "^7.0 || ^8.0",
+ "symfony/phpunit-bridge": "^7.0 || ^8.0",
+ "symfony/yaml": "^7.0 || ^8.0"
},
"extra": {
"branch-alias": {
diff --git a/src/Command/SearchClearCommand.php b/src/Command/SearchClearCommand.php
index d255f10..cd006ce 100644
--- a/src/Command/SearchClearCommand.php
+++ b/src/Command/SearchClearCommand.php
@@ -15,10 +15,7 @@
#[AsCommand(name: 'search:clear')]
final class SearchClearCommand extends IndexCommand
{
- /**
- * @return void
- */
- protected function configure()
+ protected function configure(): void
{
$this
->setDescription('Clear index (remove all data but keep index and settings)')
diff --git a/src/Command/SearchImportCommand.php b/src/Command/SearchImportCommand.php
index 7930170..8139113 100644
--- a/src/Command/SearchImportCommand.php
+++ b/src/Command/SearchImportCommand.php
@@ -46,10 +46,7 @@ public function __construct(
$this->searchClient = $searchClient;
}
- /**
- * @return void
- */
- protected function configure()
+ protected function configure(): void
{
$this
->setDescription('Import given entity into search engine')
diff --git a/src/Command/SearchSettingsBackupCommand.php b/src/Command/SearchSettingsBackupCommand.php
index a82c283..f48211e 100644
--- a/src/Command/SearchSettingsBackupCommand.php
+++ b/src/Command/SearchSettingsBackupCommand.php
@@ -12,10 +12,7 @@
#[AsCommand(name: 'search:settings:backup')]
final class SearchSettingsBackupCommand extends SearchSettingsCommand
{
- /**
- * @return void
- */
- protected function configure()
+ protected function configure(): void
{
$this
->setDescription('Backup search engine settings into your project')
diff --git a/src/Command/SearchSettingsPushCommand.php b/src/Command/SearchSettingsPushCommand.php
index c1d4e7c..c80f257 100644
--- a/src/Command/SearchSettingsPushCommand.php
+++ b/src/Command/SearchSettingsPushCommand.php
@@ -12,10 +12,7 @@
#[AsCommand(name: 'search:settings:push')]
final class SearchSettingsPushCommand extends SearchSettingsCommand
{
- /**
- * @return void
- */
- protected function configure()
+ protected function configure(): void
{
$this
->setDescription('Push settings from your project to the search engine')
diff --git a/src/DependencyInjection/AlgoliaSearchExtension.php b/src/DependencyInjection/AlgoliaSearchExtension.php
index 9aca9e9..4826295 100644
--- a/src/DependencyInjection/AlgoliaSearchExtension.php
+++ b/src/DependencyInjection/AlgoliaSearchExtension.php
@@ -8,9 +8,9 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;
/**
@@ -23,14 +23,12 @@
final class AlgoliaSearchExtension extends Extension
{
/**
- * @return void
- *
* @throws \InvalidArgumentException|\Exception
*/
- public function load(array $configs, ContainerBuilder $container)
+ public function load(array $configs, ContainerBuilder $container): void
{
- $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
- $loader->load('services.xml');
+ $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
+ $loader->load('services.yaml');
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml
deleted file mode 100644
index 013c24b..0000000
--- a/src/Resources/config/services.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-