diff --git a/packages/seal-algolia-adapter/bin/drop_all_indexes.php b/packages/seal-algolia-adapter/bin/drop_all_indexes.php index e6b25fb0..04c383fc 100755 --- a/packages/seal-algolia-adapter/bin/drop_all_indexes.php +++ b/packages/seal-algolia-adapter/bin/drop_all_indexes.php @@ -38,8 +38,7 @@ echo 'Delete ... ' . $value['name'] . \PHP_EOL; try { - $client->initIndex($value['name']) - ->delete(); + $client->deleteIndex($value['name']); } catch (\Exception) { echo 'Errored ... ' . $value['name'] . \PHP_EOL; $return = 1; diff --git a/packages/seal-algolia-adapter/composer.json b/packages/seal-algolia-adapter/composer.json index 6624e0a8..0003d817 100644 --- a/packages/seal-algolia-adapter/composer.json +++ b/packages/seal-algolia-adapter/composer.json @@ -29,7 +29,7 @@ "require": { "php": "^8.1", "schranz-search/seal": "^0.5", - "algolia/algoliasearch-client-php": "^3.3", + "algolia/algoliasearch-client-php": "^4.4", "psr/container": "^1.0 || ^2.0" }, "require-dev": { diff --git a/packages/seal-algolia-adapter/composer.lock b/packages/seal-algolia-adapter/composer.lock index e0fc9556..e1b4868e 100644 --- a/packages/seal-algolia-adapter/composer.lock +++ b/packages/seal-algolia-adapter/composer.lock @@ -4,82 +4,193 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2751b687ebfb4261a2153bde506af186", + "content-hash": "fa09a4b18cf343ed73a10da813548648", "packages": [ { "name": "algolia/algoliasearch-client-php", - "version": "v3.x-dev", + "version": "4.4.1", "source": { "type": "git", "url": "https://github.com/algolia/algoliasearch-client-php.git", - "reference": "11dccc9ac31039d7fbaf1826baea0d41562b6088" + "reference": "42b49bd41f34db3bfbac71675f264af865187e16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/algolia/algoliasearch-client-php/zipball/11dccc9ac31039d7fbaf1826baea0d41562b6088", - "reference": "11dccc9ac31039d7fbaf1826baea0d41562b6088", + "url": "https://api.github.com/repos/algolia/algoliasearch-client-php/zipball/42b49bd41f34db3bfbac71675f264af865187e16", + "reference": "42b49bd41f34db3bfbac71675f264af865187e16", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "php": "^7.3 || ^8.0", + "guzzlehttp/psr7": "^2.0", + "php": ">=8.1", "psr/http-message": "^1.1 || ^2.0", "psr/log": "^1.0 || ^2.0 || ^3.0", "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "fzaninotto/faker": "^1.8", - "phpunit/phpunit": "^8.0 || ^9.0", - "symfony/yaml": "^2.0 || ^4.0" + "friendsofphp/php-cs-fixer": "^2.0 || ^3.5.0", + "phpstan/phpstan": "^1.12", + "phpunit/phpunit": "^11.0", + "vlucas/phpdotenv": "^5.4" }, "suggest": { "guzzlehttp/guzzle": "If you prefer to use Guzzle HTTP client instead of the Http Client implementation provided by the package" }, - "default-branch": true, - "bin": [ - "bin/algolia-doctor" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-2.0": "2.0.x-dev" - } - }, "autoload": { "files": [ - "src/Http/Psr7/functions.php", - "src/functions.php" + "lib/Http/Psr7/functions.php" ], "psr-4": { - "Algolia\\AlgoliaSearch\\": "src/" + "Algolia\\AlgoliaSearch\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "unlicense" ], "authors": [ { - "name": "Algolia Team", - "email": "contact@algolia.com" + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" } ], - "description": "Algolia Search API Client for PHP", + "description": "API powering the features of Algolia.", + "homepage": "https://openapi-generator.tech", "keywords": [ - "algolia", "api", - "client", + "openapi", + "openapi-generator", + "openapitools", "php", - "search" + "rest", + "sdk" ], "support": { "issues": "https://github.com/algolia/algoliasearch-client-php/issues", - "source": "https://github.com/algolia/algoliasearch-client-php/tree/v3" + "source": "https://github.com/algolia/algoliasearch-client-php/tree/4.4.1" + }, + "time": "2024-09-12T08:26:17+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.x-dev", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "default-branch": true, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, - "time": "2024-04-24T09:57:53+00:00" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2024-07-18T11:15:46+00:00" }, { "name": "psr/container", @@ -135,6 +246,61 @@ }, "time": "2023-09-22T11:11:30+00:00" }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, { "name": "psr/http-message", "version": "dev-master", @@ -292,6 +458,50 @@ }, "time": "2022-04-08T16:41:45+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "schranz-search/seal", "version": "0.5.x-dev", @@ -732,12 +942,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "475a18cf4979acc3287f9f4c77f4a21440e5673b" + "reference": "da764a2d57a3a7afedaf3d5d087bae298a8c6c39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/475a18cf4979acc3287f9f4c77f4a21440e5673b", - "reference": "475a18cf4979acc3287f9f4c77f4a21440e5673b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/da764a2d57a3a7afedaf3d5d087bae298a8c6c39", + "reference": "da764a2d57a3a7afedaf3d5d087bae298a8c6c39", "shasum": "" }, "require": { @@ -782,7 +992,7 @@ "type": "github" } ], - "time": "2024-09-12T18:55:49+00:00" + "time": "2024-09-13T15:07:48+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -1166,12 +1376,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3c69d315bdf79080c8e115b69d1961c6905b0e18" + "reference": "319b9f2e4a608fdc98b3e3397f249d05e1fbb803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3c69d315bdf79080c8e115b69d1961c6905b0e18", - "reference": "3c69d315bdf79080c8e115b69d1961c6905b0e18", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/319b9f2e4a608fdc98b3e3397f249d05e1fbb803", + "reference": "319b9f2e4a608fdc98b3e3397f249d05e1fbb803", "shasum": "" }, "require": { @@ -1243,7 +1453,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.34" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5" }, "funding": [ { @@ -1259,7 +1469,7 @@ "type": "tidelift" } ], - "time": "2024-09-13T05:19:38+00:00" + "time": "2024-09-14T05:29:33+00:00" }, { "name": "rector/rector", diff --git a/packages/seal-algolia-adapter/src/AlgoliaAdapter.php b/packages/seal-algolia-adapter/src/AlgoliaAdapter.php index 97cf500f..db025fc8 100644 --- a/packages/seal-algolia-adapter/src/AlgoliaAdapter.php +++ b/packages/seal-algolia-adapter/src/AlgoliaAdapter.php @@ -13,7 +13,7 @@ namespace Schranz\Search\SEAL\Adapter\Algolia; -use Algolia\AlgoliaSearch\SearchClient; +use Algolia\AlgoliaSearch\Api\SearchClient; use Schranz\Search\SEAL\Adapter\AdapterInterface; use Schranz\Search\SEAL\Adapter\IndexerInterface; use Schranz\Search\SEAL\Adapter\SchemaManagerInterface; diff --git a/packages/seal-algolia-adapter/src/AlgoliaAdapterFactory.php b/packages/seal-algolia-adapter/src/AlgoliaAdapterFactory.php index 1c854d5d..893acb8c 100644 --- a/packages/seal-algolia-adapter/src/AlgoliaAdapterFactory.php +++ b/packages/seal-algolia-adapter/src/AlgoliaAdapterFactory.php @@ -13,8 +13,8 @@ namespace Schranz\Search\SEAL\Adapter\Algolia; -use Algolia\AlgoliaSearch\Config\SearchConfig; -use Algolia\AlgoliaSearch\SearchClient; +use Algolia\AlgoliaSearch\Api\SearchClient; +use Algolia\AlgoliaSearch\Configuration\SearchConfig; use Psr\Container\ContainerInterface; use Schranz\Search\SEAL\Adapter\AdapterFactoryInterface; use Schranz\Search\SEAL\Adapter\AdapterInterface; diff --git a/packages/seal-algolia-adapter/src/AlgoliaIndexer.php b/packages/seal-algolia-adapter/src/AlgoliaIndexer.php index bf4dcfc5..6ed1efe4 100644 --- a/packages/seal-algolia-adapter/src/AlgoliaIndexer.php +++ b/packages/seal-algolia-adapter/src/AlgoliaIndexer.php @@ -13,7 +13,7 @@ namespace Schranz\Search\SEAL\Adapter\Algolia; -use Algolia\AlgoliaSearch\SearchClient; +use Algolia\AlgoliaSearch\Api\SearchClient; use Schranz\Search\SEAL\Adapter\IndexerInterface; use Schranz\Search\SEAL\Marshaller\Marshaller; use Schranz\Search\SEAL\Schema\Index; @@ -40,19 +40,25 @@ public function save(Index $index, array $document, array $options = []): TaskIn { $identifierField = $index->getIdentifierField(); - $searchIndex = $this->client->initIndex($index->name); + $document = $this->marshaller->marshall($index->fields, $document); + $document['objectID'] = $document[$identifierField->name]; // TODO check objectIDKey instead see: https://github.com/algolia/algoliasearch-client-php/issues/738 - $batchIndexingResponse = $searchIndex->saveObject( - $this->marshaller->marshall($index->fields, $document), - ['objectIDKey' => $identifierField->name], + $batchIndexingResponse = $this->client->saveObject( + $index->name, + $document, ); if (!($options['return_slow_promise_result'] ?? false)) { return null; } - return new AsyncTask(function () use ($batchIndexingResponse, $document) { - $batchIndexingResponse->wait(); + return new AsyncTask(function () use ($batchIndexingResponse, $index, $document) { + \assert(isset($batchIndexingResponse['taskID']) && \is_int($batchIndexingResponse['taskID']), 'Task ID is expected to be returned by algolia client.'); + + $this->client->waitForTask( + $index->name, + $batchIndexingResponse['taskID'], + ); return $document; }); @@ -60,16 +66,19 @@ public function save(Index $index, array $document, array $options = []): TaskIn public function delete(Index $index, string $identifier, array $options = []): TaskInterface|null { - $searchIndex = $this->client->initIndex($index->name); - - $batchIndexingResponse = $searchIndex->deleteObject($identifier); + $batchIndexingResponse = $this->client->deleteObject($index->name, $identifier); if (!($options['return_slow_promise_result'] ?? false)) { return null; } - return new AsyncTask(function () use ($batchIndexingResponse) { - $batchIndexingResponse->wait(); + return new AsyncTask(function () use ($batchIndexingResponse, $index) { + \assert(isset($batchIndexingResponse['taskID']) && \is_int($batchIndexingResponse['taskID']), 'Task ID is expected to be returned by algolia client.'); + + $this->client->waitForTask( + $index->name, + $batchIndexingResponse['taskID'], + ); }); } } diff --git a/packages/seal-algolia-adapter/src/AlgoliaSchemaManager.php b/packages/seal-algolia-adapter/src/AlgoliaSchemaManager.php index 25424b03..dd1563ed 100644 --- a/packages/seal-algolia-adapter/src/AlgoliaSchemaManager.php +++ b/packages/seal-algolia-adapter/src/AlgoliaSchemaManager.php @@ -13,7 +13,7 @@ namespace Schranz\Search\SEAL\Adapter\Algolia; -use Algolia\AlgoliaSearch\SearchClient; +use Algolia\AlgoliaSearch\Api\SearchClient; use Schranz\Search\SEAL\Adapter\SchemaManagerInterface; use Schranz\Search\SEAL\Schema\Field\GeoPointField; use Schranz\Search\SEAL\Schema\Index; @@ -29,33 +29,38 @@ public function __construct( public function existIndex(Index $index): bool { - $index = $this->client->initIndex($index->name); - - return $index->exists(); + return $this->client->indexExists($index->name); } public function dropIndex(Index $index, array $options = []): TaskInterface|null { - $searchIndex = $this->client->initIndex($index->name); - $indexResponses = []; - $indexResponse = $searchIndex->delete(); - $indexResponses[] = $indexResponse; + $indexResponses[] = [ + 'indexName' => $index->name, + ...$this->client->deleteIndex( // @phpstan-ignore-line + $index->name, + ), + ]; if ([] !== $index->sortableFields) { // we need to wait for removing of primary index // see also: https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/delete-indices/#delete-multiple-indices // see also: https://support.algolia.com/hc/en-us/requests/540200 - $indexResponse->wait(); + $this->client->waitForTask( + $indexResponses[0]['indexName'], + $indexResponses[0]['taskID'], + ); } foreach ($index->sortableFields as $field) { foreach (['asc', 'desc'] as $direction) { - $searchIndex = $this->client->initIndex( - $index->name . '__' . \str_replace('.', '_', $field) . '_' . $direction, - ); - - $indexResponses[] = $searchIndex->delete(); + $sortIndexName = $index->name . '__' . \str_replace('.', '_', $field) . '_' . $direction; + $indexResponses[] = [ + 'indexName' => $sortIndexName, + ...$this->client->deleteIndex( // @phpstan-ignore-line + $sortIndexName, + ), + ]; } } @@ -65,16 +70,17 @@ public function dropIndex(Index $index, array $options = []): TaskInterface|null return new AsyncTask(function () use ($indexResponses) { foreach ($indexResponses as $indexResponse) { - $indexResponse->wait(); + $this->client->waitForTask( + $indexResponse['indexName'], + $indexResponse['taskID'], + ); } }); } public function createIndex(Index $index, array $options = []): TaskInterface|null { - $searchIndex = $this->client->initIndex($index->name); $geoPointField = $index->getGeoPointField(); - $replicas = []; foreach ($index->sortableFields as $field) { if ($geoPointField?->name === $field) { @@ -103,19 +109,26 @@ public function createIndex(Index $index, array $options = []): TaskInterface|nu } $indexResponses = []; - $indexResponses[] = $searchIndex->setSettings($attributes); + $indexResponses[] = [ + 'indexName' => $index->name, + ...$this->client->setSettings($index->name, $attributes), // @phpstan-ignore-line + ]; foreach ($index->sortableFields as $field) { foreach (['asc', 'desc'] as $direction) { - $searchIndex = $this->client->initIndex( - $index->name . '__' . \str_replace('.', '_', $field) . '_' . $direction, - ); - - $indexResponses[] = $searchIndex->setSettings([ - 'ranking' => [ - $direction . '(' . $field . ')', - ], - ]); + $sortIndexName = $index->name . '__' . \str_replace('.', '_', $field) . '_' . $direction; + + $indexResponses[] = [ + 'indexName' => $sortIndexName, + ...$this->client->setSettings( // @phpstan-ignore-line + $sortIndexName, + [ + 'ranking' => [ + $direction . '(' . $field . ')', + ], + ], + ), + ]; } } @@ -125,7 +138,10 @@ public function createIndex(Index $index, array $options = []): TaskInterface|nu return new AsyncTask(function () use ($indexResponses) { foreach ($indexResponses as $indexResponse) { - $indexResponse->wait(); + $this->client->waitForTask( + $indexResponse['indexName'], + $indexResponse['taskID'], + ); } }); } diff --git a/packages/seal-algolia-adapter/src/AlgoliaSearcher.php b/packages/seal-algolia-adapter/src/AlgoliaSearcher.php index e5441bb9..918f2b62 100644 --- a/packages/seal-algolia-adapter/src/AlgoliaSearcher.php +++ b/packages/seal-algolia-adapter/src/AlgoliaSearcher.php @@ -13,8 +13,8 @@ namespace Schranz\Search\SEAL\Adapter\Algolia; +use Algolia\AlgoliaSearch\Api\SearchClient; use Algolia\AlgoliaSearch\Exceptions\NotFoundException; -use Algolia\AlgoliaSearch\SearchClient; use Schranz\Search\SEAL\Adapter\SearcherInterface; use Schranz\Search\SEAL\Marshaller\Marshaller; use Schranz\Search\SEAL\Schema\Index; @@ -51,10 +51,12 @@ public function search(Search $search): Result $index = $search->indexes[\array_key_first($search->indexes)]; $identifierField = $index->getIdentifierField(); - $searchIndex = $this->client->initIndex($index->name); - try { - $data = $searchIndex->getObject($search->filters[0]->identifier, ['objectIDKey' => $identifierField->name]); + /** @var array $data */ + $data = $this->client->getObject( + $index->name, + $search->filters[0]->identifier, + ); } catch (NotFoundException) { return new Result( $this->hitsToDocuments($search->indexes, []), @@ -84,8 +86,6 @@ public function search(Search $search): Result $indexName .= '__' . \str_replace('.', '_', $sortByField) . '_' . $search->sortBys[$sortByField]; } - $searchIndex = $this->client->initIndex($indexName); - $query = ''; $filters = $geoFilters = []; foreach ($search->filters as $filter) { @@ -128,11 +128,17 @@ public function search(Search $search): Result $searchParams['offset'] ??= 0; // length would be ignored without offset see: https://www.algolia.com/doc/api-reference/api-parameters/length/ } - $data = $searchIndex->search($query, $searchParams); + if ('' !== $query) { + $searchParams['query'] = $query; + } + + $data = $this->client->searchSingleIndex($indexName, $searchParams); + \assert(\is_array($data) && isset($data['hits']) && \is_array($data['hits']), 'The "hits" array is expected to be returned by algolia client.'); + \assert(isset($data['nbHits']) && \is_int($data['nbHits']), 'The "nbHits" value is expected to be returned by algolia client.'); return new Result( $this->hitsToDocuments($search->indexes, $data['hits']), - $data['nbHits'] ?? null, + $data['nbHits'] ?? null, // @phpstan-ignore-line ); } diff --git a/packages/seal-algolia-adapter/tests/ClientHelper.php b/packages/seal-algolia-adapter/tests/ClientHelper.php index d35e3b43..09fb6226 100644 --- a/packages/seal-algolia-adapter/tests/ClientHelper.php +++ b/packages/seal-algolia-adapter/tests/ClientHelper.php @@ -13,7 +13,7 @@ namespace Schranz\Search\SEAL\Adapter\Algolia\Tests; -use Algolia\AlgoliaSearch\SearchClient; +use Algolia\AlgoliaSearch\Api\SearchClient; use Schranz\Search\SEAL\Adapter\AdapterFactory; use Schranz\Search\SEAL\Adapter\Algolia\AlgoliaAdapterFactory;