Bläddra i källkod

update meilisearch-php package

joe 3 år sedan
förälder
incheckning
f1cca79981
64 ändrade filer med 771 tillägg och 3573 borttagningar
  1. 1 1
      composer.json
  2. 16 11
      composer.lock
  3. 16 11
      vendor/composer/installed.json
  4. 5 5
      vendor/composer/installed.php
  5. 2 2
      vendor/composer/platform_check.php
  6. 0 309
      vendor/meilisearch/meilisearch-php/.code-samples.meilisearch.yaml
  7. 0 20
      vendor/meilisearch/meilisearch-php/.editorconfig
  8. 0 27
      vendor/meilisearch/meilisearch-php/.github/release-draft-template.yml
  9. 0 66
      vendor/meilisearch/meilisearch-php/.github/workflows/pre-release-tests.yml
  10. 0 16
      vendor/meilisearch/meilisearch-php/.github/workflows/release-drafter.yml
  11. 0 82
      vendor/meilisearch/meilisearch-php/.github/workflows/tests.yml
  12. 0 3
      vendor/meilisearch/meilisearch-php/.gitignore
  13. 0 19
      vendor/meilisearch/meilisearch-php/.php_cs.dist
  14. 0 111
      vendor/meilisearch/meilisearch-php/CONTRIBUTING.md
  15. 92 39
      vendor/meilisearch/meilisearch-php/README.md
  16. 0 9
      vendor/meilisearch/meilisearch-php/bors.toml
  17. 15 7
      vendor/meilisearch/meilisearch-php/composer.json
  18. 0 14
      vendor/meilisearch/meilisearch-php/phpunit.xml
  19. 0 7
      vendor/meilisearch/meilisearch-php/scripts/tests.sh
  20. 22 34
      vendor/meilisearch/meilisearch-php/src/Client.php
  21. 2 4
      vendor/meilisearch/meilisearch-php/src/Contracts/Endpoint.php
  22. 3 3
      vendor/meilisearch/meilisearch-php/src/Contracts/Http.php
  23. 17 26
      vendor/meilisearch/meilisearch-php/src/Delegates/HandlesIndex.php
  24. 0 18
      vendor/meilisearch/meilisearch-php/src/Delegates/HandlesSystem.php
  25. 44 4
      vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesDocuments.php
  26. 0 5
      vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesDumps.php
  27. 33 0
      vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesKeys.php
  28. 30 12
      vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesSettings.php
  29. 28 0
      vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesTasks.php
  30. 101 60
      vendor/meilisearch/meilisearch-php/src/Endpoints/Indexes.php
  31. 25 0
      vendor/meilisearch/meilisearch-php/src/Endpoints/Keys.php
  32. 50 0
      vendor/meilisearch/meilisearch-php/src/Endpoints/Tasks.php
  33. 21 20
      vendor/meilisearch/meilisearch-php/src/Exceptions/ApiException.php
  34. 1 1
      vendor/meilisearch/meilisearch-php/src/Exceptions/CommunicationException.php
  35. 1 1
      vendor/meilisearch/meilisearch-php/src/Exceptions/InvalidArgumentException.php
  36. 48 0
      vendor/meilisearch/meilisearch-php/src/Exceptions/InvalidResponseBodyException.php
  37. 16 0
      vendor/meilisearch/meilisearch-php/src/Exceptions/JsonDecodingException.php
  38. 16 0
      vendor/meilisearch/meilisearch-php/src/Exceptions/JsonEncodingException.php
  39. 12 12
      vendor/meilisearch/meilisearch-php/src/Exceptions/TimeOutException.php
  40. 60 60
      vendor/meilisearch/meilisearch-php/src/Http/Client.php
  41. 43 0
      vendor/meilisearch/meilisearch-php/src/Http/Serialize/Json.php
  42. 31 0
      vendor/meilisearch/meilisearch-php/src/Http/Serialize/SerializerInterface.php
  43. 6 1
      vendor/meilisearch/meilisearch-php/src/MeiliSearch.php
  44. 13 63
      vendor/meilisearch/meilisearch-php/src/Search/SearchResult.php
  45. 0 310
      vendor/meilisearch/meilisearch-php/tests/Endpoints/ClientTest.php
  46. 0 318
      vendor/meilisearch/meilisearch-php/tests/Endpoints/DocumentsTest.php
  47. 0 32
      vendor/meilisearch/meilisearch-php/tests/Endpoints/DumpTest.php
  48. 0 215
      vendor/meilisearch/meilisearch-php/tests/Endpoints/IndexTest.php
  49. 0 74
      vendor/meilisearch/meilisearch-php/tests/Endpoints/KeysAndPermissionsTest.php
  50. 0 605
      vendor/meilisearch/meilisearch-php/tests/Endpoints/SearchTest.php
  51. 0 63
      vendor/meilisearch/meilisearch-php/tests/Endpoints/UpdatesTest.php
  52. 0 36
      vendor/meilisearch/meilisearch-php/tests/Exceptions/ApiExceptionTest.php
  53. 0 20
      vendor/meilisearch/meilisearch-php/tests/Http/ClientTest.php
  54. 0 227
      vendor/meilisearch/meilisearch-php/tests/Search/SearchResultTest.php
  55. 0 55
      vendor/meilisearch/meilisearch-php/tests/Settings/AttributesForFacetingTest.php
  56. 0 60
      vendor/meilisearch/meilisearch-php/tests/Settings/DisplayedAttributesTest.php
  57. 0 48
      vendor/meilisearch/meilisearch-php/tests/Settings/DistinctAttributeTest.php
  58. 0 67
      vendor/meilisearch/meilisearch-php/tests/Settings/RankingRulesTest.php
  59. 0 57
      vendor/meilisearch/meilisearch-php/tests/Settings/SearchableAttributesTest.php
  60. 0 140
      vendor/meilisearch/meilisearch-php/tests/Settings/SettingsTest.php
  61. 0 56
      vendor/meilisearch/meilisearch-php/tests/Settings/StopWordsTest.php
  62. 0 59
      vendor/meilisearch/meilisearch-php/tests/Settings/SynonymsTest.php
  63. 0 47
      vendor/meilisearch/meilisearch-php/tests/TestCase.php
  64. 1 1
      vendor/services.php

+ 1 - 1
composer.json

@@ -45,7 +45,7 @@
         "robthree/twofactorauth": "^1.8",
         "yurunsoft/yurun-oauth-login": "^3.0",
         "yurunsoft/pay-sdk": "^3.1",
-        "meilisearch/meilisearch-php": "^0.17.2",
+        "meilisearch/meilisearch-php": "^0.22.0",
         "php-http/guzzle6-adapter": "^2.0",
         "http-interop/http-factory-guzzle": "^1.0"
     },

+ 16 - 11
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "9a2a47bf5e158d941c5020cb3f8f61c7",
+    "content-hash": "5b70d660d0327d0a8f3f70b8f94f9ccb",
     "packages": [
         {
             "name": "adbario/php-dot-notation",
@@ -1326,16 +1326,16 @@
         },
         {
             "name": "meilisearch/meilisearch-php",
-            "version": "v0.17.2",
+            "version": "v0.22.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/meilisearch/meilisearch-php.git",
-                "reference": "a200a32093ae44c04523f6fd014ec888707ceb9e"
+                "reference": "0229ce11be0ac2ede91577bbcd6bdfe17af63e05"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/meilisearch/meilisearch-php/zipball/a200a32093ae44c04523f6fd014ec888707ceb9e",
-                "reference": "a200a32093ae44c04523f6fd014ec888707ceb9e",
+                "url": "https://api.github.com/repos/meilisearch/meilisearch-php/zipball/0229ce11be0ac2ede91577bbcd6bdfe17af63e05",
+                "reference": "0229ce11be0ac2ede91577bbcd6bdfe17af63e05",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1346,16 +1346,21 @@
             },
             "require": {
                 "ext-json": "*",
-                "php": ">=7.2",
+                "php": "^7.4 || ^8.0",
                 "php-http/client-common": "^2.0",
                 "php-http/discovery": "^1.7",
                 "php-http/httplug": "^2.1"
             },
             "require-dev": {
-                "friendsofphp/php-cs-fixer": "^2.16",
+                "friendsofphp/php-cs-fixer": "^3.0",
                 "guzzlehttp/guzzle": "^7.1",
                 "http-interop/http-factory-guzzle": "^1.0",
-                "phpunit/phpunit": "^8.5 || ^9.0"
+                "phpstan/extension-installer": "^1.1",
+                "phpstan/phpstan": "^1.4",
+                "phpstan/phpstan-deprecation-rules": "^1.0",
+                "phpstan/phpstan-phpunit": "^1.0",
+                "phpstan/phpstan-strict-rules": "^1.1",
+                "phpunit/phpunit": "^9.5"
             },
             "suggest": {
                 "guzzlehttp/guzzle": "Use Guzzle ^7 as HTTP client",
@@ -1377,7 +1382,7 @@
                     "email": "clementine@meilisearch.com"
                 }
             ],
-            "description": "PHP wrapper for the MeiliSearch API",
+            "description": "PHP wrapper for the Meilisearch API",
             "keywords": [
                 "api",
                 "client",
@@ -1388,9 +1393,9 @@
             ],
             "support": {
                 "issues": "https://github.com/meilisearch/meilisearch-php/issues",
-                "source": "https://github.com/meilisearch/meilisearch-php/tree/v0.17.2"
+                "source": "https://github.com/meilisearch/meilisearch-php/tree/v0.22.0"
             },
-            "time": "2021-04-26T18:31:30+00:00"
+            "time": "2022-02-14T16:00:33+00:00"
         },
         {
             "name": "monolog/monolog",

+ 16 - 11
vendor/composer/installed.json

@@ -1458,17 +1458,17 @@
         },
         {
             "name": "meilisearch/meilisearch-php",
-            "version": "v0.17.2",
-            "version_normalized": "0.17.2.0",
+            "version": "v0.22.0",
+            "version_normalized": "0.22.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/meilisearch/meilisearch-php.git",
-                "reference": "a200a32093ae44c04523f6fd014ec888707ceb9e"
+                "reference": "0229ce11be0ac2ede91577bbcd6bdfe17af63e05"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/meilisearch/meilisearch-php/zipball/a200a32093ae44c04523f6fd014ec888707ceb9e",
-                "reference": "a200a32093ae44c04523f6fd014ec888707ceb9e",
+                "url": "https://api.github.com/repos/meilisearch/meilisearch-php/zipball/0229ce11be0ac2ede91577bbcd6bdfe17af63e05",
+                "reference": "0229ce11be0ac2ede91577bbcd6bdfe17af63e05",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1479,22 +1479,27 @@
             },
             "require": {
                 "ext-json": "*",
-                "php": ">=7.2",
+                "php": "^7.4 || ^8.0",
                 "php-http/client-common": "^2.0",
                 "php-http/discovery": "^1.7",
                 "php-http/httplug": "^2.1"
             },
             "require-dev": {
-                "friendsofphp/php-cs-fixer": "^2.16",
+                "friendsofphp/php-cs-fixer": "^3.0",
                 "guzzlehttp/guzzle": "^7.1",
                 "http-interop/http-factory-guzzle": "^1.0",
-                "phpunit/phpunit": "^8.5 || ^9.0"
+                "phpstan/extension-installer": "^1.1",
+                "phpstan/phpstan": "^1.4",
+                "phpstan/phpstan-deprecation-rules": "^1.0",
+                "phpstan/phpstan-phpunit": "^1.0",
+                "phpstan/phpstan-strict-rules": "^1.1",
+                "phpunit/phpunit": "^9.5"
             },
             "suggest": {
                 "guzzlehttp/guzzle": "Use Guzzle ^7 as HTTP client",
                 "http-interop/http-factory-guzzle": "Factory for guzzlehttp/guzzle"
             },
-            "time": "2021-04-26T18:31:30+00:00",
+            "time": "2022-02-14T16:00:33+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -1512,7 +1517,7 @@
                     "email": "clementine@meilisearch.com"
                 }
             ],
-            "description": "PHP wrapper for the MeiliSearch API",
+            "description": "PHP wrapper for the Meilisearch API",
             "keywords": [
                 "api",
                 "client",
@@ -1523,7 +1528,7 @@
             ],
             "support": {
                 "issues": "https://github.com/meilisearch/meilisearch-php/issues",
-                "source": "https://github.com/meilisearch/meilisearch-php/tree/v0.17.2"
+                "source": "https://github.com/meilisearch/meilisearch-php/tree/v0.22.0"
             },
             "install-path": "../meilisearch/meilisearch-php"
         },

+ 5 - 5
vendor/composer/installed.php

@@ -5,7 +5,7 @@
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
-        'reference' => '897ff510ac9cfe4f8d456fc5fceb1347431b47ea',
+        'reference' => 'ba488f1f151ad43238fe906578bed47fb69c2d32',
         'name' => 'topthink/think',
         'dev' => true,
     ),
@@ -332,12 +332,12 @@
             'dev_requirement' => false,
         ),
         'meilisearch/meilisearch-php' => array(
-            'pretty_version' => 'v0.17.2',
-            'version' => '0.17.2.0',
+            'pretty_version' => 'v0.22.0',
+            'version' => '0.22.0.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../meilisearch/meilisearch-php',
             'aliases' => array(),
-            'reference' => 'a200a32093ae44c04523f6fd014ec888707ceb9e',
+            'reference' => '0229ce11be0ac2ede91577bbcd6bdfe17af63e05',
             'dev_requirement' => false,
         ),
         'monolog/monolog' => array(
@@ -1045,7 +1045,7 @@
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
-            'reference' => '897ff510ac9cfe4f8d456fc5fceb1347431b47ea',
+            'reference' => 'ba488f1f151ad43238fe906578bed47fb69c2d32',
             'dev_requirement' => false,
         ),
         'topthink/think-captcha' => array(

+ 2 - 2
vendor/composer/platform_check.php

@@ -4,8 +4,8 @@
 
 $issues = array();
 
-if (!(PHP_VERSION_ID >= 70205)) {
-    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
+if (!(PHP_VERSION_ID >= 70400)) {
+    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
 }
 
 if ($issues) {

+ 0 - 309
vendor/meilisearch/meilisearch-php/.code-samples.meilisearch.yaml

@@ -1,309 +0,0 @@
-# This code-samples file is used by the MeiliSearch documentation
-# Every example written here will be automatically fetched by
-# the documentation on build
-# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
----
-get_one_index_1: |-
-  $client->index('movies')->fetchRawInfo();
-list_all_indexes_1: |-
-  $client->getAllIndexes();
-create_an_index_1: |-
-  $client->createIndex('movies', ['primaryKey' => 'movie_id']);
-update_an_index_1: |-
-  $client->updateIndex('movies', ['primaryKey' => 'movie_id']);
-  // OR
-  $client->index('movies')->update(['primaryKey' => 'movie_id']);
-delete_an_index_1: |-
-  $client->deleteIndex('movies');
-  // OR
-  $client->index('movies')->delete();
-get_one_document_1: |-
-  $client->index('movies')->getDocument(25684);
-get_documents_1: |-
-  $client->index('movies')->getDocuments(['limit' => 2]);
-add_or_replace_documents_1: |-
-  $client->index('movies')->addDocuments([
-    [
-      'id' => 287947
-      'title' => 'Shazam',
-      'poster' => 'https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg',
-      'overview' => 'A boy is given the ability to become an adult superhero in times of need with a single magic word.',
-      'release_date' => '2019-03-23'
-    ]
-  ]);
-add_or_update_documents_1: |-
-  $client->index('movies')->updateDocuments([
-    [
-      'id' => 287947
-      'title' => 'Shazam ⚡️',
-      'genres' => 'comedy'
-    ]
-  ]);
-delete_all_documents_1: |-
-  $client->index('movies')->deleteAllDocuments();
-delete_one_document_1: |-
-  $client->index('movies')->deleteDocument(25684);
-delete_documents_1: |-
-  $client->index('movies')->deleteDocuments([23488, 153738, 437035, 363869]);
-search_1: |-
-  // Do a search
-  $searchResults = $client->index('movies')->search('american ninja');
-
-  // Get results in an Array using a getter
-  $hits = $searchResults->getHits();
-
-  // Get the decoded response of MeiliSearch, see response below
-  $response = $searchResults->getRaw();
-get_update_1: |-
-  $client->index('movies')->getUpdateStatus(1);
-get_all_updates_1: |-
-  $client->index('movies')->getAllUpdateStatus();
-get_keys_1: |-
-  $client->getKeys();
-get_settings_1: |-
-  $client->index('movies')->getSettings();
-update_settings_1: |-
-  $client->index('movies')->updateSettings([
-    'rankingRules' => [
-      'typo',
-      'words',
-      'proximity',
-      'attribute',
-      'wordsPosition',
-      'exactness',
-      'desc(release_date)',
-      'desc(rank)'
-    ],
-    'distinctAttribute' => 'movie_id',
-    'searchableAttributes' => [
-      'title',
-      'description',
-      'genre'
-    ],
-    'displayedAttributes' => [
-      'title',
-      'description',
-      'genre',
-      'release_date'
-    ],
-    'stopWords' => [
-      'the',
-      'a',
-      'an'
-    ],
-    'synonyms' => [
-      'wolverine': ['xmen', 'logan'],
-      'logan': ['wolverine']
-    ]
-  ]);
-reset_settings_1: |-
-  $client->index('movies')->resetSettings();
-get_synonyms_1: |-
-  $client->index('movies')->getSynonyms();
-update_synonyms_1: |-
-  $client->index('movies')->updateSynonyms([
-    'wolverine': ['xmen', 'logan'],
-    'logan': ['wolverine', 'xmen'],
-    'wow': ['world of warcraft']
-  ]);
-reset_synonyms_1: |-
-  $client->index('movies')->resetSynonyms();
-get_stop_words_1: |-
-  $client->index('movies')->getStopWords();
-update_stop_words_1: |-
-  $client->index('movies')->updateStopWords(['the', 'of', 'to']);
-reset_stop_words_1: |-
-  $client->index('movies')->resetStopWords();
-get_ranking_rules_1: |-
-  $client->index('movies')->getRankingRules();
-update_ranking_rules_1: |-
-  $client->index('movies')->updateRankingRules([
-    'typo',
-    'words',
-    'proximity',
-    'attribute',
-    'wordsPosition',
-    'exactness',
-    'asc(release_date)',
-    'desc(rank)'
-  ]);
-reset_ranking_rules_1: |-
-  $client->index('movies')->resetRankingRules();
-get_distinct_attribute_1: |-
-  $client->index('movies')->getDistinctAttribute();
-update_distinct_attribute_1: |-
-  $client->index('movies')->updateDistinctAttribute('movie_id');
-reset_distinct_attribute_1: |-
-  $client->index('movies')->resetDistinctAttribute();
-get_searchable_attributes_1: |-
-  $client->index('movies')->getSearchableAttributes();
-update_searchable_attributes_1: |-
-  $client->index('movies')->updateSearchableAttributes([
-    'title',
-    'description',
-    'genre'
-  ]);
-reset_searchable_attributes_1: |-
-  $client->index('movies')->resetSearchableAttributes();
-get_attributes_for_faceting_1: |-
-  $client->index('movies')->getAttributesForFaceting();
-update_attributes_for_faceting_1: |-
-  $client->index('movies')->updateAttributesForFaceting([
-    'genres',
-    'director'
-  ]);
-reset_attributes_for_faceting_1: |-
-  $client->index('movies')->resetAttributesForFaceting();
-get_displayed_attributes_1: |-
-  $client->index('movies')->getDisplayedAttributes();
-update_displayed_attributes_1: |-
-  $client->index('movies')->updateDisplayedAttributes([
-    'title',
-    'description',
-    'genre',
-    'release_date'
-  ]);
-reset_displayed_attributes_1: |-
-  $client->index('movies')->resetDisplayedAttributes();
-get_index_stats_1: |-
-  $client->index('movies')->stats();
-get_indexes_stats_1: |-
-  $client->stats();
-get_health_1: |-
-  $client->health();
-get_version_1: |-
-  $client->version();
-distinct_attribute_guide_1: |-
-  $client->index('jackets')->updateDistinctAttribute('product_id');
-field_properties_guide_searchable_1: |-
-  $client->index('movies')->updateSearchableAttributes([
-    'title',
-    'description',
-    'genre'
-  ]);
-field_properties_guide_displayed_1: |-
-  $client->index('movies')->updateDisplayedAttributes([
-    'title',
-    'description',
-    'genre',
-    'release_date'
-  ]);
-filtering_guide_1: |-
-  $client->index('movies')->search('Avengers', ['filters' => 'release_date > 795484800']);
-filtering_guide_2: |-
-  $client->index('movies')->search('Avengers', ['filters' => 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")']);
-filtering_guide_3: |-
-  $client->index('movies')->search('horror', ['filters' => 'director = "Jordan Peele"']);
-filtering_guide_4: |-
-  $client->index('movies')->search('Planet of the Apes', ['filters' => 'rating >= 3 AND (NOT director = "Tim Burton")']);
-search_parameter_guide_query_1: |-
-  $client->index('movies')->search('shifu');
-search_parameter_guide_offset_1: |-
-  $client->index('movies')->search('shifu', ['offset' => 1]);
-search_parameter_guide_limit_1: |-
-  $client->index('movies')->search('shifu', ['limit' => 1]);
-search_parameter_guide_retrieve_1: |-
-  $client->index('movies')->search('shifu', ['attributesToRetrieve' => ['overview', 'title']]);
-search_parameter_guide_crop_1: |-
-  $client->index('movies')->search('shifu', ['attributesToCrop' => ['overview'], 'cropLength' => 10]);
-search_parameter_guide_highlight_1: |-
-  $client->index('movies')->search('shifu', ['attributesToHighlight' => ['overview']]);
-search_parameter_guide_filter_1: |-
-  $client->index('movies')->search('n', ['filters' => 'title = Nightshift']);
-search_parameter_guide_filter_2: |-
-  $client->index('movies')->search('shifu', ['filters' => 'title="Kung Fu Panda"']);
-search_parameter_guide_matches_1: |-
-  $client->index('movies')->search('shifu', ['attributesToHighlight' => ['overview'], 'matches' => true]);
-settings_guide_synonyms_1: |-
-  $client->index('tops')->updateSynonyms(['sweater' => ['jumper'], 'jumper' => ['sweater']]);
-settings_guide_stop_words_1: |-
-  $client->index('movies')->updateStopWords(['the', 'a', 'an']);
-settings_guide_ranking_rules_1: |-
-  $client->index('movies')->updateRankingRules([
-    'typo',
-    'words',
-    'proximity',
-    'attribute',
-    'wordsPosition',
-    'exactness',
-    'asc(release_date)',
-    'desc(rank)'
-  ]);
-settings_guide_distinct_1: |-
-  $client->index('jackets')->updateDistinctAttribute('product_id');
-settings_guide_searchable_1: |-
-  $client->index('movies')->updateSearchableAttributes([
-    'title',
-    'description',
-    'genre'
-  ]);
-settings_guide_displayed_1: |-
-  $client->index('movies')->updateDisplayedAttributes([
-    'title',
-    'description',
-    'genre',
-    'release_date'
-  ]);
-add_movies_json_1: |-
-  $moviesJson = file_get_contents('movies.json');
-  $movies = json_decode($moviesJson);
-
-  $client->index('movies')->addDocuments($movies)
-documents_guide_add_movie_1: |-
-  $client->index('movies')->addDocuments([['movie_id' => '123sq178', 'title' => 'Amelie Poulain']]);
-search_guide_1: |-
-  $client->index('movies')->search('shifu', ['limit' => 5, 'offset' => 10]);
-search_guide_2: |-
-  $client->index('movies')->search('Avengers', ['filters' => 'release_date > 795484800']);
-getting_started_add_documents_md: |-
-  Using `meilisearch-php` with the Guzzle HTTP client:
-
-  ```bash
-  composer require meilisearch/meilisearch-php \
-      guzzlehttp/guzzle \
-      http-interop/http-factory-guzzle:^1.0
-  ```
-
-  ```php
-  <?php
-
-  require_once __DIR__ . '/vendor/autoload.php';
-
-  use MeiliSearch\Client;
-
-  $client = new Client('http://127.0.0.1:7700');
-
-  $movies_json = file_get_contents('movies.json');
-  $movies = json_decode($movies_json);
-
-  $client->index('movies')->addDocuments($movies);
-  ```
-
-  [About this SDK](https://github.com/meilisearch/meilisearch-php/)
-getting_started_search_md: |-
-  ```php
-  $index->search('botman');
-  ```
-
-  [About this SDK](https://github.com/meilisearch/meilisearch-php/)
-faceted_search_update_settings_1: |-
-  $client->index('movies')->updateAttributesForFaceting(['director', 'genres']);
-faceted_search_facet_filters_1: |-
-  $client->index('movies')->search('thriller', ['facetFilters' => [['genres:Horror', 'genres:Mystery']], 'director' => "Jordan Peele"']);
-faceted_search_facets_distribution_1: |-
-  $client->index('movies')->search('Batman', ['facetsDistribution' => ['genres']]);
-faceted_search_walkthrough_attributes_for_faceting_1: |-
-  $client->index('movies')->updateAttributesForFaceting([
-    'director',
-    'producer',
-    'genres',
-    'production_companies'
-  ]);
-faceted_search_walkthrough_facet_filters_1: |-
-  $client->index('movies')->search('thriller', ['facetFilters' => [['genres:Horror', 'genres:Mystery']], 'director' => "Jordan Peele"]);
-faceted_search_walkthrough_facets_distribution_1: |-
-  $client->index('movies')->search('Batman', ['facetsDistribution' => ['genres']);
-post_dump_1: |-
-  $client->createDump();
-get_dump_status_1: |-
-  $client->getDumpStatus('20201101-110357260');

+ 0 - 20
vendor/meilisearch/meilisearch-php/.editorconfig

@@ -1,20 +0,0 @@
-# https://editorconfig.org/
-
-root = true
-
-[*]
-trim_trailing_whitespace = true
-insert_final_newline     = true
-end_of_line              = lf
-charset                  = utf-8
-tab_width                = 4
-indent_style             = space
-
-[*.php]
-indent_size              = 4
-
-[*.md]
-max_line_length          = 80
-
-[*.{yaml,yml}]
-indent_size              = 2

+ 0 - 27
vendor/meilisearch/meilisearch-php/.github/release-draft-template.yml

@@ -1,27 +0,0 @@
-name-template: 'v$RESOLVED_VERSION 🐘'
-tag-template: 'v$RESOLVED_VERSION'
-exclude-labels:
-  - 'skip-changelog'
-version-resolver:
-  minor:
-    labels:
-      - 'breaking-change'
-  default: patch
-categories:
-  - title: 'Breaking changes ⚠️'
-    label: 'breaking-change'
-template: |
-  ## Changes
-
-  $CHANGES
-
-  Thanks again to $CONTRIBUTORS! 🎉
-no-changes-template: 'Changes are coming soon 😎'
-sort-direction: 'ascending'
-replacers:
-  - search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
-    replace: ''
-  - search: '/(?:and )?@bors(?:\[bot\])?,?/g'
-    replace: ''
-  - search: '/(?:and )?@meili-bot,?/g'
-    replace: ''

+ 0 - 66
vendor/meilisearch/meilisearch-php/.github/workflows/pre-release-tests.yml

@@ -1,66 +0,0 @@
-# Testing the code base against the MeiliSearch pre-releases
-name: Pre-Release Tests
-
-# Will only run for PRs and pushes to bump-meilisearch-v*
-on:
-  push:
-    branches: bump-meilisearch-v*
-  pull_request:
-    branches: bump-meilisearch-v*
-
-jobs:
-  tests:
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        php-versions: ['7.2', '7.3', '7.4', '8.0']
-    name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
-    steps:
-    - uses: actions/checkout@v1
-    - name: Install PHP
-      uses: shivammathur/setup-php@v2
-      with:
-        php-version: ${{ matrix.php-versions }}
-    - name: Validate composer.json and composer.lock
-      run: composer validate
-    - name: Install dependencies
-      run: |
-        composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
-        composer install --prefer-dist --no-progress --no-suggest
-    - name: Get the latest MeiliSearch RC
-      run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
-    - name: MeiliSearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
-      run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} ./meilisearch --master-key=masterKey --no-analytics=true
-    - name: Run test suite - default HTTP client (Guzzle 7)
-      run: |
-        sh scripts/tests.sh
-        composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
-    - name: Run test suite - php-http/guzzle6-adapter
-      # Don't run on PHP 8
-      # Guzzle 6 is not compatible with PHP 8.0
-      if: ${{ !startsWith(matrix.php-versions, '8.') }}
-      run: |
-        composer require --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
-        sh scripts/tests.sh
-        composer remove --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
-    - name: Run test suite - symfony/http-client
-      run: |
-        composer require --dev symfony/http-client nyholm/psr7
-        sh scripts/tests.sh
-        composer remove --dev symfony/http-client nyholm/psr7
-    - name: Run test suite - php-http/curl-client
-      # Don't run on PHP 8
-      # php-http/curl-client is currently not compatible with PHP 8.0
-      if: ${{ !startsWith(matrix.php-versions, '8.') }}
-      run: |
-        composer require --dev php-http/curl-client nyholm/psr7
-        sh scripts/tests.sh
-        composer remove --dev php-http/curl-client nyholm/psr7
-    - name: Run test suite - kriswallsmith/buzz
-      # Don't run on PHP 8
-      # kriswallsmith/buzz is currently not compatible with PHP 8.0
-      if: ${{ !startsWith(matrix.php-versions, '8.') }}
-      run: |
-        composer require --dev kriswallsmith/buzz nyholm/psr7
-        sh scripts/tests.sh
-        composer remove --dev kriswallsmith/buzz nyholm/psr7

+ 0 - 16
vendor/meilisearch/meilisearch-php/.github/workflows/release-drafter.yml

@@ -1,16 +0,0 @@
-name: Release Drafter
-
-on:
-  push:
-    branches:
-      - main
-
-jobs:
-  update_release_draft:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: release-drafter/release-drafter@v5
-        with:
-          config-name: release-draft-template.yml
-        env:
-          GITHUB_TOKEN: ${{ secrets.RELEASE_DRAFTER_TOKEN }}

+ 0 - 82
vendor/meilisearch/meilisearch-php/.github/workflows/tests.yml

@@ -1,82 +0,0 @@
-name: Tests
-
-on:
-  pull_request:
-  push:
-    # trying and staging branches are for BORS config
-    branches:
-      - trying
-      - staging
-      - main
-
-jobs:
-  lint:
-    runs-on: ubuntu-latest
-    name: linter-check
-    steps:
-      - uses: actions/checkout@v1
-      - name: Install PHP
-        uses: shivammathur/setup-php@v2
-        with:
-          php-version: 7.4
-      - name: Install dependencies
-        run: composer update --prefer-dist --no-progress
-      - name: Run linter
-        run: vendor/bin/php-cs-fixer fix -v --config=.php_cs.dist --using-cache=no --dry-run --allow-risky=yes
-
-  tests:
-    # Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
-    # Will still run for each push to bump-meilisearch-v*
-    if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        php-versions: ['7.2', '7.3', '7.4', '8.0']
-    name: integration-tests (PHP ${{ matrix.php-versions }})
-    steps:
-    - uses: actions/checkout@v1
-    - name: Install PHP
-      uses: shivammathur/setup-php@v2
-      with:
-        php-version: ${{ matrix.php-versions }}
-    - name: Validate composer.json and composer.lock
-      run: composer validate
-    - name: Install dependencies
-      run: |
-        composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
-        composer update --prefer-dist --no-progress
-    - name: MeiliSearch (latest version) setup with Docker
-      run: docker run -d -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
-    - name: Run test suite - default HTTP client (Guzzle 7)
-      run: |
-        sh scripts/tests.sh
-        composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
-    - name: Run test suite - php-http/guzzle6-adapter
-      # Don't run on PHP 8
-      # Guzzle 6 is not compatible with PHP 8.0
-      if: ${{ !startsWith(matrix.php-versions, '8.') }}
-      run: |
-        composer require --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
-        sh scripts/tests.sh
-        composer remove --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
-    - name: Run test suite - symfony/http-client
-      run: |
-        composer require --dev symfony/http-client nyholm/psr7
-        sh scripts/tests.sh
-        composer remove --dev symfony/http-client nyholm/psr7
-    - name: Run test suite - php-http/curl-client
-      # Don't run on PHP 8
-      # php-http/curl-client is currently not compatible with PHP 8.0
-      if: ${{ !startsWith(matrix.php-versions, '8.') }}
-      run: |
-        composer require --dev php-http/curl-client nyholm/psr7
-        sh scripts/tests.sh
-        composer remove --dev php-http/curl-client nyholm/psr7
-    - name: Run test suite - kriswallsmith/buzz
-      # Don't run on PHP 8
-      # kriswallsmith/buzz is currently not compatible with PHP 8.0
-      if: ${{ !startsWith(matrix.php-versions, '8.') }}
-      run: |
-        composer require --dev kriswallsmith/buzz nyholm/psr7
-        sh scripts/tests.sh
-        composer remove --dev kriswallsmith/buzz nyholm/psr7

+ 0 - 3
vendor/meilisearch/meilisearch-php/.gitignore

@@ -1,3 +0,0 @@
-composer.lock
-/vendor/
-.php_cs.cache

+ 0 - 19
vendor/meilisearch/meilisearch-php/.php_cs.dist

@@ -1,19 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-$finder = \PhpCsFixer\Finder::create()
-    ->in(__DIR__.DIRECTORY_SEPARATOR.'src')
-    ->in(__DIR__.DIRECTORY_SEPARATOR.'tests')
-    ->append(['.php_cs.dist']);
-
-$rules = [
-    '@Symfony' => true,
-    'declare_strict_types' => true,
-    'void_return' => true,
-    'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
-];
-
-return \PhpCsFixer\Config::create()
-    ->setRules($rules)
-    ->setFinder($finder);

+ 0 - 111
vendor/meilisearch/meilisearch-php/CONTRIBUTING.md

@@ -1,111 +0,0 @@
-# Contributing
-
-First of all, thank you for contributing to MeiliSearch! The goal of this document is to provide everything you need to know in order to contribute to MeiliSearch and its different integrations.
-
-<!-- MarkdownTOC autolink="true" style="ordered" indent="   " -->
-
-- [Assumptions](#assumptions)
-- [How to Contribute](#how-to-contribute)
-- [Development Workflow](#development-workflow)
-- [Git Guidelines](#git-guidelines)
-- [Release Process (for internal team only)](#release-process-for-internal-team-only)
-
-<!-- /MarkdownTOC -->
-
-## Assumptions
-
-1. **You're familiar with [GitHub](https://github.com) and the [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) (PR) workflow.**
-2. **You've read the MeiliSearch [documentation](https://docs.meilisearch.com) and the [README](/README.md).**
-3. **You know about the [MeiliSearch community](https://docs.meilisearch.com/learn/what_is_meilisearch/contact.html). Please use this for help.**
-
-## How to Contribute
-
-1. Make sure that the contribution you want to make is explained or detailed in a GitHub issue! Find an [existing issue](https://github.com/meilisearch/meilisearch-php/issues/) or [open a new one](https://github.com/meilisearch/meilisearch-php/issues/new).
-2. Once done, [fork the meilisearch-php repository](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) in your own GitHub account. Ask a maintainer if you want your issue to be checked before making a PR.
-3. [Create a new Git branch](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository).
-4. Review the [Development Workflow](#workflow) section that describes the steps to maintain the repository.
-5. Make the changes on your branch.
-6. [Submit the branch as a PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) pointing to the `main` branch of the main meilisearch-php repository. A maintainer should comment and/or review your Pull Request within a few days. Although depending on the circumstances, it may take longer.<br>
- We do not enforce a naming convention for the PRs, but **please use something descriptive of your changes**, having in mind that the title of your PR will be automatically added to the next [release changelog](https://github.com/meilisearch/meilisearch-php/releases/).
-
-## Development Workflow
-
-### Setup
-
-```bash
-composer install
-```
-
-### Tests and Linter
-
-Each PR should pass the tests and the linter to be accepted.
-
-```bash
-# Tests
-docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
-docker run -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
-composer test
-# Linter (with auto-fix)
-composer lint:fix
-# Linter (without auto-fix)
-composer lint
-```
-
-## Git Guidelines
-
-### Git Branches
-
-All changes must be made in a branch and submitted as PR.
-We do not enforce any branch naming style, but please use something descriptive of your changes.
-
-### Git Commits
-
-As minimal requirements, your commit message should:
-- be capitalized
-- not finish by a dot or any other punctuation character (!,?)
-- start with a verb so that we can read your commit message this way: "This commit will ...", where "..." is the commit message.
-  e.g.: "Fix the home page button" or "Add more tests for create_index method"
-
-We don't follow any other convention, but if you want to use one, we recommend [this one](https://chris.beams.io/posts/git-commit/).
-
-### GitHub Pull Requests
-
-Some notes on GitHub PRs:
-
-- [Convert your PR as a draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request) if your changes are a work in progress: no one will review it until you pass your PR as ready for review.<br>
-  The draft PR can be very useful if you want to show that you are working on something and make your work visible.
-- The branch related to the PR must be **up-to-date with `main`** before merging. Fortunately, this project [integrates a bot](https://github.com/meilisearch/integration-guides/blob/main/guides/bors.md) to automatically enforce this requirement without the PR author having to do it manually..
-- All PRs must be reviewed and approved by at least one maintainer.
-- The PR title should be accurate and descriptive of the changes. The title of the PR will be indeed automatically added to the next [release changelogs](https://github.com/meilisearch/meilisearch-php/releases/).
-
-## Release Process (for internal team only)
-
-MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/).
-
-### Automation to Rebase and Merge the PRs
-
-This project integrates a bot that helps us manage pull requests merging.<br>
-_[Read more about this](https://github.com/meilisearch/integration-guides/blob/main/guides/bors.md)._
-
-### Automated Changelogs
-
-This project integrates a tool to create automated changelogs.<br>
-_[Read more about this](https://github.com/meilisearch/integration-guides/blob/main/guides/release-drafter.md)._
-
-### How to Publish the Release
-
-⚠️ Before doing anything, make sure you got through the guide about [Releasing an Integration](https://github.com/meilisearch/integration-guides/blob/main/guides/integration-release.md).
-
-Make a PR modifying the file [`src/MeiliSearch.php`](/src/MeiliSearch.php) with the right version.
-
-```php
-const VERSION = 'X.X.X';
-```
-
-Once the changes are merged on `main`, you can publish the current draft release via the [GitHub interface](https://github.com/meilisearch/meilisearch-php/releases).
-
-A WebHook will be triggered and push the package to [Packagist](https://packagist.org/packages/meilisearch/meilisearch-php).
-
-<hr>
-
-Thank you again for reading this through, we can not wait to begin to work with you if you made your way through this contributing guide ❤️

+ 92 - 39
vendor/meilisearch/meilisearch-php/README.md

@@ -1,11 +1,11 @@
 <p align="center">
-  <img src="https://res.cloudinary.com/meilisearch/image/upload/v1587402338/SDKs/meilisearch_php.svg" alt="MeiliSearch-PHP" width="200" height="200" />
+  <img src="https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/meilisearch_php.svg" alt="Meilisearch-PHP" width="200" height="200" />
 </p>
 
-<h1 align="center">MeiliSearch PHP</h1>
+<h1 align="center">Meilisearch PHP</h1>
 
 <h4 align="center">
-  <a href="https://github.com/meilisearch/MeiliSearch">MeiliSearch</a> |
+  <a href="https://github.com/meilisearch/meilisearch">Meilisearch</a> |
   <a href="https://docs.meilisearch.com">Documentation</a> |
   <a href="https://slack.meilisearch.com">Slack</a> |
   <a href="https://roadmap.meilisearch.com/tabs/1-under-consideration">Roadmap</a> |
@@ -20,18 +20,18 @@
   <a href="https://app.bors.tech/repositories/28780"><img src="https://bors.tech/images/badge_small.svg" alt="Bors enabled"></a>
 </p>
 
-<p align="center">⚡ The MeiliSearch API client written for PHP 🐘</p>
+<p align="center">⚡ The Meilisearch API client written for PHP 🐘</p>
 
-**MeiliSearch PHP** is the MeiliSearch API client for PHP developers.
+**Meilisearch PHP** is the Meilisearch API client for PHP developers.
 
-**MeiliSearch** is an open-source search engine. [Discover what MeiliSearch is!](https://github.com/meilisearch/MeiliSearch)
+**Meilisearch** is an open-source search engine. [Discover what Meilisearch is!](https://github.com/meilisearch/Meilisearch)
 
 ## Table of Contents <!-- omit in toc -->
 
 - [📖 Documentation](#-documentation)
 - [🔧 Installation](#-installation)
 - [🚀 Getting Started](#-getting-started)
-- [🤖 Compatibility with MeiliSearch](#-compatibility-with-meilisearch)
+- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)
 - [💡 Learn More](#-learn-more)
 - [🧰 HTTP Client Compatibilities](#-http-client-compatibilities)
   - [Customize your HTTP Client](#customize-your-http-client)
@@ -61,18 +61,21 @@ composer require meilisearch/meilisearch-php symfony/http-client nyholm/psr7:^1.
 
 💡 *More HTTP client installations compatible with this package can be found [in this section](#-http-client-compatibilities).*
 
-### Run MeiliSearch <!-- omit in toc -->
+### Run Meilisearch <!-- omit in toc -->
 
-There are many easy ways to [download and run a MeiliSearch instance](https://docs.meilisearch.com/reference/features/installation.html#download-and-launch).
+There are many easy ways to [download and run a Meilisearch instance](https://docs.meilisearch.com/reference/features/installation.html#download-and-launch).
 
-For example, if you use Docker:
+For example, using the `curl` command in your [Terminal](https://itconnect.uw.edu/learn/workshops/online-tutorials/web-publishing/what-is-a-terminal/):
 
-```bash
-docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
-docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey
+```sh
+#Install Meilisearch
+curl -L https://install.meilisearch.com | sh
+
+# Launch Meilisearch
+./meilisearch --master-key=masterKey
 ```
 
-NB: you can also download MeiliSearch from **Homebrew** or **APT**.
+NB: you can also download Meilisearch from **Homebrew** or **APT** or even run it using **Docker**.
 
 ## 🚀 Getting Started
 
@@ -88,29 +91,28 @@ use MeiliSearch\Client;
 $client = new Client('http://127.0.0.1:7700', 'masterKey');
 
 # An index is where the documents are stored.
-$index = $client->index('books');
+$index = $client->index('movies');
 
 $documents = [
-    ['book_id' => 123,  'title' => 'Pride and Prejudice', 'author' => 'Jane Austen'],
-    ['book_id' => 456,  'title' => 'Le Petit Prince', 'author' => 'Antoine de Saint-Exupéry'],
-    ['book_id' => 1,    'title' => 'Alice In Wonderland', 'author' => 'Lewis Carroll'],
-    ['book_id' => 1344, 'title' => 'The Hobbit', 'author' => 'J. R. R. Tolkien'],
-    ['book_id' => 4,    'title' => 'Harry Potter and the Half-Blood Prince', 'author' => 'J. K. Rowling'],
-    ['book_id' => 42,   'title' => 'The Hitchhiker\'s Guide to the Galaxy', 'author' => 'Douglas Adams, Eoin Colfer, Thomas Tidholm'],
+    ['id' => 1,  'title' => 'Carol', 'genres' => ['Romance, Drama']],
+    ['id' => 2,  'title' => 'Wonder Woman', 'genres' => ['Action, Adventure']],
+    ['id' => 3,  'title' => 'Life of Pi', 'genres' => ['Adventure, Drama']],
+    ['id' => 4,  'title' => 'Mad Max: Fury Road', 'genres' => ['Adventure, Science Fiction']],
+    ['id' => 5,  'title' => 'Moana', 'genres' => ['Fantasy, Action']],
+    ['id' => 6,  'title' => 'Philadelphia', 'genres' => ['Drama']],
 ];
 
-# If the index 'books' does not exist, MeiliSearch creates it when you first add the documents.
-$index->addDocuments($documents); // => { "updateId": 0 }
+# If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.
+$index->addDocuments($documents); // => { "uid": 0 }
 ```
 
-With the `updateId`, you can check the status (`enqueued`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
-
+With the `uid`, you can check the status (`enqueued`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://docs.meilisearch.com/reference/api/tasks.html#get-task).
 
 #### Basic Search <!-- omit in toc -->
 
 ```php
-// MeiliSearch is typo-tolerant:
-$hits = $index->search('harry pottre')->getHits();
+// Meilisearch is typo-tolerant:
+$hits = $index->search('wondre woman')->getHits();
 print_r($hits);
 ```
 
@@ -121,8 +123,12 @@ Array
 (
     [0] => Array
         (
-            [id] => 4
-            [title] => Harry Potter and the Half-Blood Prince
+            [id] => 2
+            [title] => Wonder Woman
+            [genres] => Array
+                (
+                     [0] => Action, Adventure
+                )
         )
 )
 ```
@@ -135,10 +141,9 @@ All the supported options are described in the [search parameters](https://docs.
 
 ```php
 $index->search(
-    'prince',
+    'phil',
     [
         'attributesToHighlight' => ['*'],
-        'filters' => 'book_id > 10'
     ]
 )->getRaw(); // Return in Array format
 ```
@@ -149,20 +154,68 @@ JSON output:
 {
     "hits": [
         {
-            "book_id": 456,
-            "title": "Le Petit Prince"
+            "id": 6,
+            "title": "Philadelphia",
+            "genre": ["Drama"],
+            "_formatted": {
+                "id": 6,
+                "title": "<em>Phil</em>adelphia",
+                "genre": ["Drama"]
+            }
         }
     ],
     "offset": 0,
     "limit": 20,
-    "processingTimeMs": 10,
-    "query": "prince"
+    "processingTimeMs": 0,
+    "query": "phil"
+}
+```
+#### Custom Search With Filters <!-- omit in toc -->
+
+If you want to enable filtering, you must add your attributes to the `filterableAttributes` index setting.
+
+```php
+$index->updateFilterableAttributes([
+  'id',
+  'genres'
+]);
+```
+
+You only need to perform this operation once.
+
+Note that Meilisearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [tasks](https://docs.meilisearch.com/reference/api/tasks.html#get-task)).
+
+Then, you can perform the search:
+
+```php
+$index->search(
+  'wonder',
+  [
+    'filter' => ['id > 1 AND genres = Action']
+  ]
+);
+```
+
+```json
+{
+  "hits": [
+    {
+      "id": 2,
+      "title": "Wonder Woman",
+      "genres": ["Action","Adventure"]
+    }
+  ],
+  "offset": 0,
+  "limit": 20,
+  "nbHits": 1,
+  "processingTimeMs": 0,
+  "query": "wonder"
 }
 ```
 
-## 🤖 Compatibility with MeiliSearch
+## 🤖 Compatibility with Meilisearch
 
-This package only guarantees the compatibility with the [version v0.20.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.20.0).
+This package only guarantees the compatibility with the [version v0.25.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.25.0).
 
 ## 💡 Learn More
 
@@ -213,7 +266,7 @@ composer require meilisearch/meilisearch-php kriswallsmith/buzz nyholm/psr7:^1.0
 ### Customize your HTTP Client
 
 For some reason, you might want to pass a custom configuration to your own HTTP client.<br>
-Make sure you have a [PSR-18](https://www.php-fig.org/psr/psr-18/) compatible client when you initialize the MeiliSearch client.
+Make sure you have a [PSR-18](https://www.php-fig.org/psr/psr-18/) compatible client when you initialize the Meilisearch client.
 
 Following the example in the [Getting Started](#-getting-started) section, with the Guzzle HTTP client:
 
@@ -229,4 +282,4 @@ If you want to know more about the development workflow or want to contribute, p
 
 <hr>
 
-**MeiliSearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.
+**Meilisearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.

+ 0 - 9
vendor/meilisearch/meilisearch-php/bors.toml

@@ -1,9 +0,0 @@
-status = [
-    'linter-check',
-    'integration-tests (PHP 7.2)',
-    'integration-tests (PHP 7.3)',
-    'integration-tests (PHP 7.4)',
-    'integration-tests (PHP 8.0)'
-]
-# 1 hour timeout
-timeout-sec = 3600

+ 15 - 7
vendor/meilisearch/meilisearch-php/composer.json

@@ -1,6 +1,6 @@
 {
     "name": "meilisearch/meilisearch-php",
-    "description": "PHP wrapper for the MeiliSearch API",
+    "description": "PHP wrapper for the Meilisearch API",
     "keywords": ["meilisearch", "instant", "search", "api", "client", "php"],
     "type": "library",
     "license": "MIT",
@@ -12,7 +12,7 @@
     ],
     "minimum-stability": "stable",
     "require": {
-        "php": ">=7.2",
+        "php": "^7.4 || ^8.0",
         "ext-json": "*",
         "php-http/discovery": "^1.7",
         "php-http/httplug": "^2.1",
@@ -33,17 +33,25 @@
         "http-interop/http-factory-guzzle": "Factory for guzzlehttp/guzzle"
     },
     "require-dev": {
-        "phpunit/phpunit": "^8.5 || ^9.0",
-        "friendsofphp/php-cs-fixer": "^2.16",
+        "phpunit/phpunit": "^9.5",
+        "friendsofphp/php-cs-fixer": "^3.0",
         "guzzlehttp/guzzle": "^7.1",
-        "http-interop/http-factory-guzzle": "^1.0"
+        "http-interop/http-factory-guzzle": "^1.0",
+        "phpstan/phpstan": "^1.4",
+        "phpstan/extension-installer": "^1.1",
+        "phpstan/phpstan-strict-rules": "^1.1",
+        "phpstan/phpstan-phpunit": "^1.0",
+        "phpstan/phpstan-deprecation-rules": "^1.0"
     },
     "scripts": {
         "lint": [
-            "./vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --verbose --config=./.php_cs.dist --diff --show-progress=estimating --dry-run --using-cache=yes --allow-risky=yes"
+            "./vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --verbose --config=.php-cs-fixer.dist.php --using-cache=no --dry-run --diff"
         ],
         "lint:fix": [
-            "./vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --verbose --config=./.php_cs.dist --diff --show-progress=estimating --using-cache=no --allow-risky=yes"
+            "./vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --verbose --config=.php-cs-fixer.dist.php --using-cache=no  --diff"
+        ],
+        "phpstan": [
+            "php ./vendor/bin/phpstan"
         ],
         "test": [
             "sh scripts/tests.sh"

+ 0 - 14
vendor/meilisearch/meilisearch-php/phpunit.xml

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit bootstrap="vendor/autoload.php"
-         convertErrorsToExceptions="true"
-         convertNoticesToExceptions="true"
-         convertWarningsToExceptions="true"
-         stopOnFailure="false"
-         cacheResult="false"
-         colors="true">
-    <testsuites>
-        <testsuite name="Tests">
-            <directory suffix="Test.php">./tests</directory>
-        </testsuite>
-    </testsuites>
-</phpunit>

+ 0 - 7
vendor/meilisearch/meilisearch-php/scripts/tests.sh

@@ -1,7 +0,0 @@
-#!/bin/sh
-
-echo 'Setting FDs limit to 1000'
-ulimit -Sn 1000
-
-echo "Launching tests..."
-vendor/bin/phpunit --color tests/

+ 22 - 34
vendor/meilisearch/meilisearch-php/src/Client.php

@@ -7,59 +7,47 @@ namespace MeiliSearch;
 use MeiliSearch\Delegates\HandlesIndex;
 use MeiliSearch\Delegates\HandlesSystem;
 use MeiliSearch\Endpoints\Delegates\HandlesDumps;
+use MeiliSearch\Endpoints\Delegates\HandlesKeys;
+use MeiliSearch\Endpoints\Delegates\HandlesTasks;
 use MeiliSearch\Endpoints\Dumps;
 use MeiliSearch\Endpoints\Health;
 use MeiliSearch\Endpoints\Indexes;
 use MeiliSearch\Endpoints\Keys;
 use MeiliSearch\Endpoints\Stats;
+use MeiliSearch\Endpoints\Tasks;
 use MeiliSearch\Endpoints\Version;
 use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestFactoryInterface;
 
 class Client
 {
     use HandlesDumps;
     use HandlesIndex;
+    use HandlesTasks;
+    use HandlesKeys;
     use HandlesSystem;
 
     private $http;
-
-    /**
-     * @var Indexes
-     */
-    private $index;
-
-    /**
-     * @var Health
-     */
-    private $health;
-
-    /**
-     * @var Version
-     */
-    private $version;
-
-    /**
-     * @var Keys
-     */
-    private $keys;
-
-    /**
-     * @var Stats
-     */
-    private $stats;
-
-    /**
-     * @var Dumps
-     */
-    private $dumps;
-
-    public function __construct(string $url, string $apiKey = null, ClientInterface $httpClient = null)
-    {
-        $this->http = new Http\Client($url, $apiKey, $httpClient);
+    private Indexes $index;
+    private Health $health;
+    private Version $version;
+    private Keys $keys;
+    private Stats $stats;
+    private Tasks $tasks;
+    private Dumps $dumps;
+
+    public function __construct(
+        string $url,
+        string $apiKey = null,
+        ClientInterface $httpClient = null,
+        RequestFactoryInterface $requestFactory = null
+    ) {
+        $this->http = new Http\Client($url, $apiKey, $httpClient, $requestFactory);
         $this->index = new Indexes($this->http);
         $this->health = new Health($this->http);
         $this->version = new Version($this->http);
         $this->stats = new Stats($this->http);
+        $this->tasks = new Tasks($this->http);
         $this->keys = new Keys($this->http);
         $this->dumps = new Dumps($this->http);
     }

+ 2 - 4
vendor/meilisearch/meilisearch-php/src/Contracts/Endpoint.php

@@ -6,10 +6,8 @@ namespace MeiliSearch\Contracts;
 
 abstract class Endpoint
 {
-    /**
-     * @var Http
-     */
-    protected $http;
+    protected const PATH = '';
+    protected Http $http;
 
     public function __construct(Http $http)
     {

+ 3 - 3
vendor/meilisearch/meilisearch-php/src/Contracts/Http.php

@@ -6,13 +6,13 @@ namespace MeiliSearch\Contracts;
 
 interface Http
 {
-    public function get($path, array $query = []);
+    public function get(string $path, array $query = []);
 
-    public function post(string $path, $body = null, array $query = []);
+    public function post(string $path, $body = null, array $query = [], string $contentType = null);
 
     public function put(string $path, $body = null, array $query = []);
 
     public function patch(string $path, $body = null, array $query = []);
 
-    public function delete($path, array $query = []);
+    public function delete(string $path, array $query = []);
 }

+ 17 - 26
vendor/meilisearch/meilisearch-php/src/Delegates/HandlesIndex.php

@@ -5,11 +5,7 @@ declare(strict_types=1);
 namespace MeiliSearch\Delegates;
 
 use MeiliSearch\Endpoints\Indexes;
-use MeiliSearch\Exceptions\ApiException;
 
-/**
- * @property Indexes index
- */
 trait HandlesIndex
 {
     /**
@@ -20,6 +16,16 @@ trait HandlesIndex
         return $this->index->all();
     }
 
+    public function getAllRawIndexes(): array
+    {
+        return $this->index->allRaw();
+    }
+
+    public function getRawIndex(string $uid): array
+    {
+        return $this->index($uid)->fetchRawInfo();
+    }
+
     public function index(string $uid): Indexes
     {
         return new Indexes($this->http, $uid);
@@ -35,39 +41,24 @@ trait HandlesIndex
         return $this->index($uid)->delete();
     }
 
-    public function deleteAllIndexes(): void
+    public function deleteAllIndexes(): array
     {
+        $tasks = [];
         $indexes = $this->getAllIndexes();
         foreach ($indexes as $index) {
-            $index->delete();
+            $tasks[] = $index->delete();
         }
+
+        return $tasks;
     }
 
-    public function createIndex(string $uid, array $options = []): Indexes
+    public function createIndex(string $uid, array $options = []): array
     {
         return $this->index->create($uid, $options);
     }
 
-    public function updateIndex(string $uid, array $options = []): Indexes
+    public function updateIndex(string $uid, array $options = []): array
     {
         return $this->index($uid)->update($options);
     }
-
-    /**
-     * @throws ApiException
-     */
-    public function getOrCreateIndex(string $uid, array $options = []): Indexes
-    {
-        try {
-            $index = $this->getIndex($uid, $options);
-        } catch (ApiException $e) {
-            if (\is_array($e->httpBody) && 'index_not_found' === $e->httpBody['errorCode']) {
-                $index = $this->createIndex($uid, $options);
-            } else {
-                throw $e;
-            }
-        }
-
-        return $index;
-    }
 }

+ 0 - 18
vendor/meilisearch/meilisearch-php/src/Delegates/HandlesSystem.php

@@ -4,19 +4,6 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Delegates;
 
-use MeiliSearch\Endpoints\Health;
-use MeiliSearch\Endpoints\Keys;
-use MeiliSearch\Endpoints\Stats;
-use MeiliSearch\Endpoints\SysInfo;
-use MeiliSearch\Endpoints\Version;
-
-/**
- * @property Health health
- * @property Version version
- * @property SysInfo sysInfo
- * @property Stats stats
- * @property Keys keys
- */
 trait HandlesSystem
 {
     public function health(): ?array
@@ -44,9 +31,4 @@ trait HandlesSystem
     {
         return $this->stats->show();
     }
-
-    public function getKeys(): array
-    {
-        return $this->keys->show();
-    }
 }

+ 44 - 4
vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesDocuments.php

@@ -4,12 +4,9 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Endpoints\Delegates;
 
-use MeiliSearch\Contracts\Http;
+use Generator;
 use MeiliSearch\Exceptions\InvalidArgumentException;
 
-/**
- * @property Http http
- */
 trait HandlesDocuments
 {
     public function getDocument($documentId)
@@ -29,11 +26,46 @@ trait HandlesDocuments
         return $this->http->post(self::PATH.'/'.$this->uid.'/documents', $documents, ['primaryKey' => $primaryKey]);
     }
 
+    public function addDocumentsInBatches(array $documents, ?int $batchSize = 1000, ?string $primaryKey = null)
+    {
+        $promises = [];
+        foreach (self::batch($documents, $batchSize) as $batch) {
+            $promises[] = $this->addDocuments($batch, $primaryKey);
+        }
+
+        return $promises;
+    }
+
+    public function addDocumentsJson(string $documents, ?string $primaryKey = null)
+    {
+        return $this->http->post(self::PATH.'/'.$this->uid.'/documents', $documents, ['primaryKey' => $primaryKey], 'application/json');
+    }
+
+    public function addDocumentsNdjson(string $documents, ?string $primaryKey = null)
+    {
+        return $this->http->post(self::PATH.'/'.$this->uid.'/documents', $documents, ['primaryKey' => $primaryKey], 'application/x-ndjson');
+    }
+
+    public function addDocumentsCsv(string $documents, ?string $primaryKey = null)
+    {
+        return $this->http->post(self::PATH.'/'.$this->uid.'/documents', $documents, ['primaryKey' => $primaryKey], 'text/csv');
+    }
+
     public function updateDocuments(array $documents, ?string $primaryKey = null)
     {
         return $this->http->put(self::PATH.'/'.$this->uid.'/documents', $documents, ['primaryKey' => $primaryKey]);
     }
 
+    public function updateDocumentsInBatches(array $documents, ?int $batchSize = 1000, ?string $primaryKey = null)
+    {
+        $promises = [];
+        foreach (self::batch($documents, $batchSize) as $batch) {
+            $promises[] = $this->updateDocuments($documents, $primaryKey);
+        }
+
+        return $promises;
+    }
+
     public function deleteAllDocuments(): array
     {
         return $this->http->delete(self::PATH.'/'.$this->uid.'/documents');
@@ -61,4 +93,12 @@ trait HandlesDocuments
             throw InvalidArgumentException::emptyArgument('documentId');
         }
     }
+
+    private static function batch(array $documents, int $batchSize): Generator
+    {
+        $batches = array_chunk($documents, $batchSize);
+        foreach ($batches as $batch) {
+            yield $batch;
+        }
+    }
 }

+ 0 - 5
vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesDumps.php

@@ -4,11 +4,6 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Endpoints\Delegates;
 
-use MeiliSearch\Endpoints\Dumps;
-
-/**
- * @property Dumps dumps
- */
 trait HandlesDumps
 {
     public function createDump(): array

+ 33 - 0
vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesKeys.php

@@ -0,0 +1,33 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Endpoints\Delegates;
+
+trait HandlesKeys
+{
+    public function getKeys(): array
+    {
+        return $this->keys->all();
+    }
+
+    public function getKey($key): array
+    {
+        return $this->keys->get($key);
+    }
+
+    public function createKey(array $options = []): array
+    {
+        return $this->keys->create($options);
+    }
+
+    public function updateKey(string $key, array $options = []): array
+    {
+        return $this->keys->update($key, $options);
+    }
+
+    public function deleteKey(string $key): array
+    {
+        return $this->keys->delete($key);
+    }
+}

+ 30 - 12
vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesSettings.php

@@ -4,11 +4,6 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Endpoints\Delegates;
 
-use MeiliSearch\Contracts\Http;
-
-/**
- * @property Http http
- */
 trait HandlesSettings
 {
     // Settings - Ranking rules
@@ -105,6 +100,12 @@ trait HandlesSettings
 
     public function updateSynonyms(array $synonyms): array
     {
+        // Patch related to https://github.com/meilisearch/meilisearch-php/issues/204.
+        // Should be removed when implementing https://github.com/meilisearch/meilisearch-php/issues/209
+        if (0 === \count($synonyms)) {
+            $synonyms = null;
+        }
+
         return $this->http->post(self::PATH.'/'.$this->uid.'/settings/synonyms', $synonyms);
     }
 
@@ -113,20 +114,37 @@ trait HandlesSettings
         return $this->http->delete(self::PATH.'/'.$this->uid.'/settings/synonyms');
     }
 
-    // Settings - Attributes for faceting
+    // Settings - Filterable Attributes
+
+    public function getFilterableAttributes(): array
+    {
+        return $this->http->get(self::PATH.'/'.$this->uid.'/settings/filterable-attributes');
+    }
+
+    public function updateFilterableAttributes(array $filterableAttributes): array
+    {
+        return $this->http->post(self::PATH.'/'.$this->uid.'/settings/filterable-attributes', $filterableAttributes);
+    }
+
+    public function resetFilterableAttributes(): array
+    {
+        return $this->http->delete(self::PATH.'/'.$this->uid.'/settings/filterable-attributes');
+    }
+
+    // Settings - Sortable Attributes
 
-    public function getAttributesForFaceting(): array
+    public function getSortableAttributes(): array
     {
-        return $this->http->get(self::PATH.'/'.$this->uid.'/settings/attributes-for-faceting');
+        return $this->http->get(self::PATH.'/'.$this->uid.'/settings/sortable-attributes');
     }
 
-    public function updateAttributesForFaceting(array $attributesForFaceting): array
+    public function updateSortableAttributes(array $sortableAttributes): array
     {
-        return $this->http->post(self::PATH.'/'.$this->uid.'/settings/attributes-for-faceting', $attributesForFaceting);
+        return $this->http->post(self::PATH.'/'.$this->uid.'/settings/sortable-attributes', $sortableAttributes);
     }
 
-    public function resetAttributesForFaceting(): array
+    public function resetSortableAttributes(): array
     {
-        return $this->http->delete(self::PATH.'/'.$this->uid.'/settings/attributes-for-faceting');
+        return $this->http->delete(self::PATH.'/'.$this->uid.'/settings/sortable-attributes');
     }
 }

+ 28 - 0
vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesTasks.php

@@ -0,0 +1,28 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Endpoints\Delegates;
+
+trait HandlesTasks
+{
+    public function getTask($uid): array
+    {
+        return $this->tasks->get($uid);
+    }
+
+    public function getTasks(): array
+    {
+        return $this->tasks->all();
+    }
+
+    public function waitForTask($uid, int $timeoutInMs = 5000, int $intervalInMs = 50): array
+    {
+        return $this->tasks->waitTask($uid, $timeoutInMs, $intervalInMs);
+    }
+
+    public function waitForTasks($uids, int $timeoutInMs = 5000, int $intervalInMs = 50): array
+    {
+        return $this->tasks->waitTasks($uids, $timeoutInMs, $intervalInMs);
+    }
+}

+ 101 - 60
vendor/meilisearch/meilisearch-php/src/Endpoints/Indexes.php

@@ -4,60 +4,91 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Endpoints;
 
+use DateTime;
 use Exception;
 use MeiliSearch\Contracts\Endpoint;
 use MeiliSearch\Contracts\Http;
 use MeiliSearch\Endpoints\Delegates\HandlesDocuments;
 use MeiliSearch\Endpoints\Delegates\HandlesSettings;
+use MeiliSearch\Endpoints\Delegates\HandlesTasks;
 use MeiliSearch\Exceptions\ApiException;
-use MeiliSearch\Exceptions\TimeOutException;
 use MeiliSearch\Search\SearchResult;
 
 class Indexes extends Endpoint
 {
     use HandlesDocuments;
     use HandlesSettings;
+    use HandlesTasks;
 
     protected const PATH = '/indexes';
 
-    /**
-     * @var string|null
-     */
-    private $uid;
-    private $primaryKey;
+    private ?string $uid;
+    private ?string $primaryKey;
+    private ?string $createdAt;
+    private ?string $updatedAt;
+    private Tasks $tasks;
 
-    public function __construct(Http $http, $uid = null, $primaryKey = null)
+    public function __construct(Http $http, $uid = null, $primaryKey = null, $createdAt = null, $updatedAt = null)
     {
         $this->uid = $uid;
         $this->primaryKey = $primaryKey;
+        $this->createdAt = $createdAt;
+        $this->updatedAt = $updatedAt;
+        $this->tasks = new Tasks($http);
+
         parent::__construct($http);
     }
 
+    protected function newInstance(array $attributes): self
+    {
+        return new self(
+            $this->http,
+            $attributes['uid'],
+            $attributes['primaryKey'],
+            $attributes['createdAt'],
+            $attributes['updatedAt'],
+        );
+    }
+
     /**
      * @return $this
-     *
+     */
+    protected function fill(array $attributes): self
+    {
+        $this->uid = $attributes['uid'];
+        $this->primaryKey = $attributes['primaryKey'];
+        $this->createdAt = $attributes['createdAt'];
+        $this->updatedAt = $attributes['updatedAt'];
+
+        return $this;
+    }
+
+    /**
      * @throws Exception|ApiException
      */
-    public function create(string $uid, array $options = []): self
+    public function create(string $uid, array $options = []): array
     {
         $options['uid'] = $uid;
 
-        $response = $this->http->post(self::PATH, $options);
-
-        return new self($this->http, $response['uid'], $response['primaryKey']);
+        return $this->http->post(self::PATH, $options);
     }
 
     public function all(): array
     {
         $indexes = [];
 
-        foreach ($this->http->get(self::PATH) as $index) {
-            $indexes[] = new self($this->http, $index['uid']);
+        foreach ($this->allRaw() as $index) {
+            $indexes[] = $this->newInstance($index);
         }
 
         return $indexes;
     }
 
+    public function allRaw(): array
+    {
+        return $this->http->get(self::PATH);
+    }
+
     public function getPrimaryKey(): ?string
     {
         return $this->primaryKey;
@@ -73,6 +104,26 @@ class Indexes extends Endpoint
         return $this->uid;
     }
 
+    public function getCreatedAt(): ?DateTime
+    {
+        return static::parseDate($this->createdAt);
+    }
+
+    public function getCreatedAtString(): ?string
+    {
+        return $this->createdAt;
+    }
+
+    public function getUpdatedAt(): ?DateTime
+    {
+        return static::parseDate($this->updatedAt);
+    }
+
+    public function getUpdatedAtString(): ?string
+    {
+        return $this->updatedAt;
+    }
+
     public function fetchRawInfo(): ?array
     {
         return $this->http->get(self::PATH.'/'.$this->uid);
@@ -81,19 +132,13 @@ class Indexes extends Endpoint
     public function fetchInfo(): self
     {
         $response = $this->fetchRawInfo();
-        $this->uid = $response['uid'];
-        $this->primaryKey = $response['primaryKey'];
 
-        return $this;
+        return $this->fill($response);
     }
 
-    public function update($body): self
+    public function update($body): array
     {
-        $response = $this->http->put(self::PATH.'/'.$this->uid, $body);
-        $this->uid = $response['uid'];
-        $this->primaryKey = $response['primaryKey'];
-
-        return $this;
+        return $this->http->put(self::PATH.'/'.$this->uid, $body);
     }
 
     public function delete(): array
@@ -101,49 +146,24 @@ class Indexes extends Endpoint
         return $this->http->delete(self::PATH.'/'.$this->uid) ?? [];
     }
 
-    // Updates
+    // Tasks
 
-    public function getUpdateStatus($updateId): array
+    public function getTask($uid): array
     {
-        return $this->http->get(self::PATH.'/'.$this->uid.'/updates/'.$updateId);
+        return $this->http->get(self::PATH.'/'.$this->uid.'/tasks'.'/'.$uid);
     }
 
-    public function getAllUpdateStatus(): array
+    public function getTasks(): array
     {
-        return $this->http->get(self::PATH.'/'.$this->uid.'/updates');
-    }
-
-    /**
-     * @param $updateId
-     * @param int $timeoutInMs
-     * @param int $intervalInMs
-     *
-     * @return mixed
-     *
-     * @throws TimeOutException
-     */
-    public function waitForPendingUpdate($updateId, $timeoutInMs = 5000, $intervalInMs = 50): array
-    {
-        $timeout_temp = 0;
-        while ($timeoutInMs > $timeout_temp) {
-            $res = $this->getUpdateStatus($updateId);
-            if ('enqueued' != $res['status']) {
-                return $res;
-            }
-            $timeout_temp += $intervalInMs;
-            usleep(1000 * $intervalInMs);
-        }
-        throw new TimeOutException();
+        return $this->http->get(self::PATH.'/'.$this->uid.'/tasks');
     }
 
     // Search
 
     /**
-     * @param string $query
-     *
      * @return SearchResult|array
      */
-    public function search($query, array $searchParams = [], array $options = [])
+    public function search(?string $query, array $searchParams = [], array $options = [])
     {
         $result = $this->rawSearch($query, $searchParams);
 
@@ -157,12 +177,7 @@ class Indexes extends Endpoint
         return $searchResult;
     }
 
-    /**
-     * @param string $query
-     *
-     * @return array
-     */
-    public function rawSearch($query, array $searchParams = [])
+    public function rawSearch(?string $query, array $searchParams = []): array
     {
         $parameters = array_merge(
             ['q' => $query],
@@ -188,6 +203,12 @@ class Indexes extends Endpoint
 
     public function updateSettings($settings): array
     {
+        // Patch related to https://github.com/meilisearch/meilisearch-php/issues/204
+        // Should be removed when implementing https://github.com/meilisearch/meilisearch-php/issues/209
+        if (\array_key_exists('synonyms', $settings) && 0 == \count($settings['synonyms'])) {
+            $settings['synonyms'] = null;
+        }
+
         return $this->http->post(self::PATH.'/'.$this->uid.'/settings', $settings);
     }
 
@@ -195,4 +216,24 @@ class Indexes extends Endpoint
     {
         return $this->http->delete(self::PATH.'/'.$this->uid.'/settings');
     }
+
+    /**
+     * @throws Exception
+     */
+    public static function parseDate(?string $dateTime): ?DateTime
+    {
+        if (null === $dateTime) {
+            return null;
+        }
+
+        try {
+            return new DateTime($dateTime);
+        } catch (\Exception $e) {
+            // Trim 9th+ digit from fractional seconds. Meilisearch server can send 9 digits; PHP supports up to 8
+            $trimPattern = '/(^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{1,8})(?:\d{1,})?(Z|[\+-]\d{2}:\d{2})$/';
+            $trimmedDate = preg_replace($trimPattern, '$1$2', $dateTime);
+
+            return new DateTime($trimmedDate);
+        }
+    }
 }

+ 25 - 0
vendor/meilisearch/meilisearch-php/src/Endpoints/Keys.php

@@ -9,4 +9,29 @@ use MeiliSearch\Contracts\Endpoint;
 class Keys extends Endpoint
 {
     protected const PATH = '/keys';
+
+    public function get($key): array
+    {
+        return $this->http->get(self::PATH.'/'.$key);
+    }
+
+    public function all(): array
+    {
+        return $this->http->get(self::PATH.'/');
+    }
+
+    public function create(array $options = []): array
+    {
+        return $this->http->post(self::PATH, $options);
+    }
+
+    public function update(string $key, array $options = []): array
+    {
+        return $this->http->patch(self::PATH.'/'.$key, $options);
+    }
+
+    public function delete(string $key): array
+    {
+        return $this->http->delete(self::PATH.'/'.$key) ?? [];
+    }
 }

+ 50 - 0
vendor/meilisearch/meilisearch-php/src/Endpoints/Tasks.php

@@ -0,0 +1,50 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Endpoints;
+
+use MeiliSearch\Contracts\Endpoint;
+use MeiliSearch\Exceptions\TimeOutException;
+
+class Tasks extends Endpoint
+{
+    protected const PATH = '/tasks';
+
+    public function get($taskUid): array
+    {
+        return $this->http->get(self::PATH.'/'.$taskUid);
+    }
+
+    public function all(): array
+    {
+        return $this->http->get(self::PATH.'/');
+    }
+
+    /**
+     * @throws TimeOutException
+     */
+    public function waitTask($taskUid, int $timeoutInMs, int $intervalInMs): array
+    {
+        $timeout_temp = 0;
+        while ($timeoutInMs > $timeout_temp) {
+            $res = $this->get($taskUid);
+            if ('enqueued' != $res['status'] && 'processing' != $res['status']) {
+                return $res;
+            }
+            $timeout_temp += $intervalInMs;
+            usleep(1000 * $intervalInMs);
+        }
+        throw new TimeOutException();
+    }
+
+    public function waitTasks(array $taskUids, int $timeoutInMs, int $intervalInMs): array
+    {
+        $tasks = [];
+        foreach ($taskUids as $taskUid) {
+            $tasks[] = $this->waitTask($taskUid, $timeoutInMs, $intervalInMs);
+        }
+
+        return $tasks;
+    }
+}

+ 21 - 20
vendor/meilisearch/meilisearch-php/src/Exceptions/ApiException.php

@@ -5,21 +5,22 @@ declare(strict_types=1);
 namespace MeiliSearch\Exceptions;
 
 use Exception;
+use Psr\Http\Message\ResponseInterface;
 
 class ApiException extends Exception
 {
     public $httpStatus = 0;
     public $message = null;
-    public $errorCode = null;
-    public $errorType = null;
-    public $errorLink = null;
+    public ?string $errorCode;
+    public ?string $errorType;
+    public ?string $errorLink;
     public $httpBody = null;
 
-    public function __construct($httpStatus, $httpBody, $previous = null)
+    public function __construct(ResponseInterface $response, $httpBody, $previous = null)
     {
         $this->httpBody = $httpBody;
-        $this->httpStatus = $httpStatus;
-        $this->message = $this->getMessageFromHttpBody();
+        $this->httpStatus = $response->getStatusCode();
+        $this->message = $this->getMessageFromHttpBody() ?? $response->getReasonPhrase();
         $this->errorCode = $this->getErrorCodeFromHttpBody();
         $this->errorLink = $this->getErrorLinkFromHttpBody();
         $this->errorType = $this->getErrorTypeFromHttpBody();
@@ -29,22 +30,22 @@ class ApiException extends Exception
 
     public function __toString()
     {
-        $base = 'MeiliSearch HTTPRequestException: Http Status: '.$this->httpStatus;
+        $base = 'Meilisearch ApiException: Http Status: '.$this->httpStatus;
 
-        if ($this->message) {
+        if (!\is_null($this->message)) {
             $base .= ' - Message: '.$this->message;
         }
 
-        if ($this->errorCode) {
-            $base .= ' - Error code: '.$this->errorCode;
+        if (!\is_null($this->errorCode)) {
+            $base .= ' - Code: '.$this->errorCode;
         }
 
-        if ($this->errorType) {
-            $base .= ' - Error type: '.$this->errorType;
+        if (!\is_null($this->errorType)) {
+            $base .= ' - Type: '.$this->errorType;
         }
 
-        if ($this->errorLink) {
-            $base .= ' - Error link: '.$this->errorLink;
+        if (!\is_null($this->errorLink)) {
+            $base .= ' - Link: '.$this->errorLink;
         }
 
         return $base;
@@ -61,8 +62,8 @@ class ApiException extends Exception
 
     private function getErrorCodeFromHttpBody(): ?string
     {
-        if (\is_array($this->httpBody) && \array_key_exists('errorCode', $this->httpBody)) {
-            return $this->httpBody['errorCode'];
+        if (\is_array($this->httpBody) && \array_key_exists('code', $this->httpBody)) {
+            return $this->httpBody['code'];
         }
 
         return null;
@@ -70,8 +71,8 @@ class ApiException extends Exception
 
     private function getErrorTypeFromHttpBody(): ?string
     {
-        if (\is_array($this->httpBody) && \array_key_exists('errorType', $this->httpBody)) {
-            return $this->httpBody['errorType'];
+        if (\is_array($this->httpBody) && \array_key_exists('type', $this->httpBody)) {
+            return $this->httpBody['type'];
         }
 
         return null;
@@ -79,8 +80,8 @@ class ApiException extends Exception
 
     private function getErrorLinkFromHttpBody(): ?string
     {
-        if (\is_array($this->httpBody) && \array_key_exists('errorLink', $this->httpBody)) {
-            return $this->httpBody['errorLink'];
+        if (\is_array($this->httpBody) && \array_key_exists('link', $this->httpBody)) {
+            return $this->httpBody['link'];
         }
 
         return null;

+ 1 - 1
vendor/meilisearch/meilisearch-php/src/Exceptions/CommunicationException.php

@@ -10,6 +10,6 @@ class CommunicationException extends Exception
 {
     public function __toString()
     {
-        return 'MeiliSearch CommunicationException: '.$this->getMessage();
+        return 'Meilisearch CommunicationException: '.$this->getMessage();
     }
 }

+ 1 - 1
vendor/meilisearch/meilisearch-php/src/Exceptions/InvalidArgumentException.php

@@ -11,7 +11,7 @@ final class InvalidArgumentException extends Exception
     public static function invalidType(string $argumentName, array $validTypes): self
     {
         return new self(
-            sprintf('Argument "%s" is not a valid type! Please provide an argument that is of type: "%s"', $argumentName, \implode('","', $validTypes)),
+            sprintf('Argument "%s" is not a valid type! Please provide an argument that is of type: "%s"', $argumentName, implode('","', $validTypes)),
             400,
             null
         );

+ 48 - 0
vendor/meilisearch/meilisearch-php/src/Exceptions/InvalidResponseBodyException.php

@@ -0,0 +1,48 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Exceptions;
+
+use Exception;
+use Psr\Http\Message\ResponseInterface;
+
+class InvalidResponseBodyException extends Exception
+{
+    public $httpStatus = 0;
+    public $httpBody = null;
+    public $message = null;
+
+    public function __construct(ResponseInterface $response, $httpBody, $previous = null)
+    {
+        $this->httpStatus = $response->getStatusCode();
+        $this->httpBody = $httpBody;
+        $this->message = $this->getMessageFromHttpBody() ?? $response->getReasonPhrase();
+
+        parent::__construct($this->message, $this->httpStatus, $previous);
+    }
+
+    public function __toString()
+    {
+        $base = 'Meilisearch InvalidResponseBodyException: Http Status: '.$this->httpStatus;
+
+        if ($this->message) {
+            $base .= ' - Message: '.$this->message;
+        }
+
+        return $base;
+    }
+
+    public function getMessageFromHttpBody(): ?string
+    {
+        if (null !== $this->httpBody) {
+            $rawText = strip_tags($this->httpBody);
+
+            if (!ctype_space($rawText)) {
+                return substr(trim($rawText), 0, 100);
+            }
+        }
+
+        return null;
+    }
+}

+ 16 - 0
vendor/meilisearch/meilisearch-php/src/Exceptions/JsonDecodingException.php

@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Exceptions;
+
+use Exception;
+use Throwable;
+
+final class JsonDecodingException extends Exception
+{
+    public function __construct(string $message, int $code = 0, ?Throwable $previous = null)
+    {
+        parent::__construct($message, $code, $previous);
+    }
+}

+ 16 - 0
vendor/meilisearch/meilisearch-php/src/Exceptions/JsonEncodingException.php

@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Exceptions;
+
+use Exception;
+use Throwable;
+
+final class JsonEncodingException extends Exception
+{
+    public function __construct(string $message, int $code = 0, ?Throwable $previous = null)
+    {
+        parent::__construct($message, $code, $previous);
+    }
+}

+ 12 - 12
vendor/meilisearch/meilisearch-php/src/Exceptions/TimeOutException.php

@@ -4,26 +4,26 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Exceptions;
 
-class TimeOutException extends \Exception
+use Exception;
+use Throwable;
+
+class TimeOutException extends Exception
 {
-    public $code = 408;
-    public $message = 'Request timed out';
+    public $code = null;
+    public $message = null;
 
-    public function __construct($message = null, $code = null, $previous = null)
+    public function __construct(?string $message = null, ?int $code = null, ?Throwable $previous = null)
     {
-        if (isset($message)) {
-            $this->message = $message;
-        }
-        if (isset($code)) {
-            $this->code = $code;
-        }
+        $this->message = $message ?? 'Request timed out';
+        $this->code = $code ?? 408;
+
         parent::__construct($this->message, $this->code, $previous);
     }
 
     public function __toString()
     {
-        $base = 'MeiliSearch TimeOutException: Code: '.$this->code;
-        if (isset($this->message)) {
+        $base = 'Meilisearch TimeOutException: Code: '.$this->code;
+        if ($this->message) {
             return $base.' - Message: '.$this->message;
         } else {
             return $base;

+ 60 - 60
vendor/meilisearch/meilisearch-php/src/Http/Client.php

@@ -9,6 +9,11 @@ use Http\Discovery\Psr18ClientDiscovery;
 use MeiliSearch\Contracts\Http;
 use MeiliSearch\Exceptions\ApiException;
 use MeiliSearch\Exceptions\CommunicationException;
+use MeiliSearch\Exceptions\InvalidResponseBodyException;
+use MeiliSearch\Exceptions\JsonDecodingException;
+use MeiliSearch\Exceptions\JsonEncodingException;
+use MeiliSearch\Http\Serialize\Json;
+use MeiliSearch\MeiliSearch;
 use Psr\Http\Client\ClientExceptionInterface;
 use Psr\Http\Client\ClientInterface;
 use Psr\Http\Client\NetworkExceptionInterface;
@@ -19,61 +24,43 @@ use Psr\Http\Message\StreamFactoryInterface;
 
 class Client implements Http
 {
-    /**
-     * @var Http
-     */
-    private $http;
-
-    /**
-     * @var RequestFactoryInterface
-     */
-    private $requestFactory;
-
-    /**
-     * @var StreamFactoryInterface
-     */
-    private $streamFactory;
-
-    /**
-     * @var array
-     */
-    private $headers;
-
-    /**
-     * @var string
-     */
-    private $apiKey;
-
-    private $baseUrl;
+    private ClientInterface $http;
+    private RequestFactoryInterface $requestFactory;
+    private StreamFactoryInterface $streamFactory;
+    private array $headers;
+    private ?string $apiKey;
+    private string $baseUrl;
+    private Json $json;
 
     /**
      * Client constructor.
-     *
-     * @param string $apiKey
      */
-    public function __construct(string $url, string $apiKey = null, ClientInterface $httpClient = null)
-    {
+    public function __construct(
+        string $url,
+        string $apiKey = null,
+        ClientInterface $httpClient = null,
+        RequestFactoryInterface $reqFactory = null
+    ) {
         $this->baseUrl = $url;
         $this->apiKey = $apiKey;
         $this->http = $httpClient ?? Psr18ClientDiscovery::find();
-        $this->requestFactory = Psr17FactoryDiscovery::findRequestFactory();
+        $this->requestFactory = $reqFactory ?? Psr17FactoryDiscovery::findRequestFactory();
         $this->streamFactory = Psr17FactoryDiscovery::findStreamFactory();
         $this->headers = array_filter([
-            'Content-type' => 'application/json',
-            'X-Meili-API-Key' => $this->apiKey,
+            'Authorization' => sprintf('Bearer %s', $this->apiKey),
+            'User-Agent' => MeiliSearch::qualifiedVersion(),
         ]);
+        $this->json = new Json();
     }
 
     /**
-     * @param $path
-     * @param array $query
-     *
      * @return mixed
      *
      * @throws ClientExceptionInterface
      * @throws ApiException
+     * @throws CommunicationException
      */
-    public function get($path, $query = [])
+    public function get(string $path, array $query = [])
     {
         $request = $this->requestFactory->createRequest(
             'GET',
@@ -84,65 +71,68 @@ class Client implements Http
     }
 
     /**
-     * @param string $path
-     * @param null   $body
-     * @param array  $query
+     * @param mixed|null $body
      *
      * @return mixed
      *
-     * @throws ClientExceptionInterface
      * @throws ApiException
+     * @throws ClientExceptionInterface
+     * @throws CommunicationException
+     * @throws JsonEncodingException
      */
-    public function post($path, $body = null, $query = [])
+    public function post(string $path, $body = null, array $query = [], string $contentType = null)
     {
+        if (!\is_null($contentType)) {
+            $this->headers['Content-type'] = $contentType;
+        } else {
+            $this->headers['Content-type'] = 'application/json';
+            $body = $this->json->serialize($body);
+        }
         $request = $this->requestFactory->createRequest(
             'POST',
             $this->baseUrl.$path.$this->buildQueryString($query)
-        )->withBody($this->streamFactory->createStream(json_encode($body)));
+            )->withBody($this->streamFactory->createStream($body));
 
         return $this->execute($request);
     }
 
-    public function put($path, $body = null, $query = [])
+    public function put(string $path, $body = null, array $query = [])
     {
+        $this->headers['Content-type'] = 'application/json';
         $request = $this->requestFactory->createRequest(
             'PUT',
             $this->baseUrl.$path.$this->buildQueryString($query)
-        )->withBody($this->streamFactory->createStream(json_encode($body)));
+        )->withBody($this->streamFactory->createStream($this->json->serialize($body)));
 
         return $this->execute($request);
     }
 
     /**
-     * @param string $path
-     * @param null   $body
-     * @param array  $query
+     * @param mixed|null $body
      *
      * @return mixed
      *
-     * @throws ClientExceptionInterface
      * @throws ApiException
+     * @throws JsonEncodingException
      */
-    public function patch($path, $body = null, $query = [])
+    public function patch(string $path, $body = null, array $query = [])
     {
+        $this->headers['Content-type'] = 'application/json';
         $request = $this->requestFactory->createRequest(
             'PATCH',
             $this->baseUrl.$path.$this->buildQueryString($query)
-        )->withBody($this->streamFactory->createStream(json_encode($body)));
+        )->withBody($this->streamFactory->createStream($this->json->serialize($body)));
 
         return $this->execute($request);
     }
 
     /**
-     * @param $path
-     * @param array $query
-     *
      * @return mixed
      *
      * @throws ClientExceptionInterface
      * @throws ApiException
      */
-    public function delete($path, $query = [])
+    public function delete(string $path, array $query = [])
     {
         $request = $this->requestFactory->createRequest(
             'DELETE',
@@ -158,7 +148,6 @@ class Client implements Http
      * @throws ApiException
      * @throws ClientExceptionInterface
      * @throws CommunicationException
-     * @throws ApiException
      */
     private function execute(RequestInterface $request)
     {
@@ -175,21 +164,32 @@ class Client implements Http
 
     private function buildQueryString(array $queryParams = []): string
     {
-        return $queryParams ? '?'.http_build_query($queryParams) : '';
+        return \count($queryParams) > 0 ? '?'.http_build_query($queryParams) : '';
     }
 
     /**
      * @return mixed
      *
      * @throws ApiException
+     * @throws InvalidResponseBodyException
+     * @throws JsonDecodingException
      */
     private function parseResponse(ResponseInterface $response)
     {
+        if (204 === $response->getStatusCode()) {
+            return null;
+        }
+
+        if (!\in_array('application/json', $response->getHeader('content-type'), true)) {
+            throw new InvalidResponseBodyException($response, $response->getBody()->getContents());
+        }
+
         if ($response->getStatusCode() >= 300) {
-            $body = json_decode($response->getBody()->getContents(), true) ?? $response->getReasonPhrase();
-            throw new ApiException($response->getStatusCode(), $body);
+            $body = $this->json->unserialize($response->getBody()->getContents()) ?? $response->getReasonPhrase();
+
+            throw new ApiException($response, $body);
         }
 
-        return json_decode($response->getBody()->getContents(), true);
+        return $this->json->unserialize($response->getBody()->getContents());
     }
 }

+ 43 - 0
vendor/meilisearch/meilisearch-php/src/Http/Serialize/Json.php

@@ -0,0 +1,43 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Http\Serialize;
+
+use JsonException;
+use MeiliSearch\Exceptions\JsonDecodingException;
+use MeiliSearch\Exceptions\JsonEncodingException;
+
+class Json implements SerializerInterface
+{
+    private const JSON_ENCODE_ERROR_MESSAGE = 'Encoding payload to json failed: "%s".';
+    private const JSON_DECODE_ERROR_MESSAGE = 'Decoding payload to json failed: "%s".';
+
+    /**
+     * {@inheritDoc}
+     */
+    public function serialize($data)
+    {
+        try {
+            $encoded = json_encode($data, JSON_THROW_ON_ERROR);
+        } catch (JsonException $e) {
+            throw new JsonEncodingException(sprintf(self::JSON_ENCODE_ERROR_MESSAGE, $e->getMessage()), $e->getCode(), $e);
+        }
+
+        return $encoded;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function unserialize(string $string)
+    {
+        try {
+            $decoded = json_decode($string, true, 512, JSON_THROW_ON_ERROR);
+        } catch (JsonException $e) {
+            throw new JsonDecodingException(sprintf(self::JSON_DECODE_ERROR_MESSAGE, $e->getMessage()), $e->getCode(), $e);
+        }
+
+        return $decoded;
+    }
+}

+ 31 - 0
vendor/meilisearch/meilisearch-php/src/Http/Serialize/SerializerInterface.php

@@ -0,0 +1,31 @@
+<?php
+
+declare(strict_types=1);
+
+namespace MeiliSearch\Http\Serialize;
+
+use MeiliSearch\Exceptions\JsonDecodingException;
+use MeiliSearch\Exceptions\JsonEncodingException;
+
+interface SerializerInterface
+{
+    /**
+     * Serialize data into string.
+     *
+     * @param string|int|float|bool|array|null $data
+     *
+     * @return string|bool
+     *
+     * @throws JsonEncodingException
+     */
+    public function serialize($data);
+
+    /**
+     * Unserialize the given string.
+     *
+     * @return string|int|float|bool|array|null
+     *
+     * @throws JsonDecodingException
+     */
+    public function unserialize(string $string);
+}

+ 6 - 1
vendor/meilisearch/meilisearch-php/src/MeiliSearch.php

@@ -6,5 +6,10 @@ namespace MeiliSearch;
 
 class MeiliSearch
 {
-    const VERSION = '0.17.2';
+    public const VERSION = '0.22.0';
+
+    public static function qualifiedVersion()
+    {
+        return sprintf('Meilisearch PHP (v%s)', MeiliSearch::VERSION);
+    }
 }

+ 13 - 63
vendor/meilisearch/meilisearch-php/src/Search/SearchResult.php

@@ -4,7 +4,6 @@ declare(strict_types=1);
 
 namespace MeiliSearch\Search;
 
-use function array_filter;
 use ArrayIterator;
 use Countable;
 use IteratorAggregate;
@@ -14,61 +13,33 @@ class SearchResult implements Countable, IteratorAggregate
     /**
      * @var array<int, array<string, mixed>>
      */
-    private $hits;
+    private array $hits;
 
     /**
-     * @var int
-     */
-    private $offset;
-
-    /**
-     * @var int
-     */
-    private $limit;
-
-    /**
-     * `nbHits` is the attributes returned by the MeiliSearch server
+     * `nbHits` is the attributes returned by the Meilisearch server
      * and its value will not be modified by the methods in this class.
      * Please, use `hitsCount` if you want to know the real size of the `hits` array at any time.
-     *
-     * @var int
-     */
-    private $nbHits;
-
-    /**
-     * @var int
-     */
-    private $hitsCount;
-
-    /**
-     * @var bool
      */
-    private $exhaustiveNbHits;
+    private int $nbHits;
 
-    /**
-     * @var int
-     */
-    private $processingTimeMs;
+    private int $hitsCount;
+    private bool $exhaustiveNbHits;
+    private int $offset;
+    private int $limit;
+    private int $processingTimeMs;
 
-    /**
-     * @var string
-     */
-    private $query;
-
-    /**
-     * @var bool|null
-     */
-    private $exhaustiveFacetsCount;
+    private string $query;
+    private ?bool $exhaustiveFacetsCount;
 
     /**
      * @var array<string, mixed>
      */
-    private $facetsDistribution;
+    private array $facetsDistribution;
 
     /**
      * @var array<string, mixed>
      */
-    private $raw;
+    private array $raw;
 
     public function __construct(array $body)
     {
@@ -89,7 +60,6 @@ class SearchResult implements Countable, IteratorAggregate
      * Return a new {@see SearchResult} instance.
      *
      * The $options parameter is an array, and the following keys are accepted:
-     * - removeZeroFacets (boolean)
      * - transformFacetsDistribution (callable)
      * - transformHits (callable)
      *
@@ -99,9 +69,6 @@ class SearchResult implements Countable, IteratorAggregate
      */
     public function applyOptions($options): self
     {
-        if (\array_key_exists('removeZeroFacets', $options) && true === $options['removeZeroFacets']) {
-            $this->removeZeroFacets();
-        }
         if (\array_key_exists('transformHits', $options) && \is_callable($options['transformHits'])) {
             $this->transformHits($options['transformHits']);
         }
@@ -127,23 +94,6 @@ class SearchResult implements Countable, IteratorAggregate
         return $this;
     }
 
-    public function removeZeroFacets(): self
-    {
-        $filterAllFacets = function (array $facets) {
-            $filterOneFacet = function (array $facet) {
-                return array_filter(
-                    $facet,
-                    function ($v, $k) { return 0 !== $v; },
-                    ARRAY_FILTER_USE_BOTH
-                );
-            };
-
-            return array_map($filterOneFacet, $facets);
-        };
-
-        return $this->transformFacetsDistribution($filterAllFacets);
-    }
-
     public function getHit(int $key, $default = null)
     {
         return $this->hits[$key] ?? $default;
@@ -238,7 +188,7 @@ class SearchResult implements Countable, IteratorAggregate
 
     public function toJSON(): string
     {
-        return \json_encode($this->toArray(), JSON_PRETTY_PRINT);
+        return json_encode($this->toArray(), JSON_PRETTY_PRINT);
     }
 
     public function getIterator(): ArrayIterator

+ 0 - 310
vendor/meilisearch/meilisearch-php/tests/Endpoints/ClientTest.php

@@ -1,310 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Client;
-use MeiliSearch\Endpoints\Indexes;
-use MeiliSearch\Exceptions\ApiException;
-use Tests\TestCase;
-
-final class ClientTest extends TestCase
-{
-    public function testGetAllIndexesWhenEmpty(): void
-    {
-        $response = $this->client->getAllIndexes();
-
-        $this->assertIsArray($response);
-        $this->assertEmpty($response);
-    }
-
-    public function testCreateIndexWithOnlyUid(): void
-    {
-        $index = $this->client->createIndex('index');
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertNull($index->getPrimaryKey());
-    }
-
-    public function testCreateIndexWithUidAndPrimaryKey(): void
-    {
-        $index = $this->client->createIndex(
-            'index',
-            ['primaryKey' => 'ObjectId']
-        );
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertSame('ObjectId', $index->getPrimaryKey());
-    }
-
-    public function testCreateIndexWithUidInOptions(): void
-    {
-        $index = $this->client->createIndex(
-            'index',
-            [
-                'uid' => 'wrong',
-                'primaryKey' => 'ObjectId',
-            ]
-        );
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertSame('ObjectId', $index->getPrimaryKey());
-    }
-
-    public function testGetAllIndexes(): void
-    {
-        $indexA = 'indexA';
-        $indexB = 'indexB';
-        $this->client->createIndex($indexA);
-        $this->client->createIndex($indexB);
-
-        $response = $this->client->getAllIndexes();
-
-        $this->assertIsArray($response);
-        $this->assertCount(2, $response);
-
-        $uids = array_map(function ($index) {
-            return $index->getUid();
-        }, $response);
-
-        $this->assertContains($indexA, $uids);
-        $this->assertContains($indexB, $uids);
-    }
-
-    public function testUpdateIndex(): void
-    {
-        $this->client->createIndex('indexA');
-
-        $index = $this->client->updateIndex('indexA', ['primaryKey' => 'id']);
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame($index->getPrimaryKey(), 'id');
-        $this->assertSame($index->getUid(), 'indexA');
-    }
-
-    public function testDeleteIndex(): void
-    {
-        $this->client->createIndex('index');
-
-        $response = $this->client->getAllIndexes();
-        $this->assertCount(1, $response);
-
-        $response = $this->client->deleteIndex('index');
-
-        $this->assertEmpty($response);
-        $response = $this->client->getAllIndexes();
-
-        $this->assertCount(0, $response);
-    }
-
-    public function testDeleteAllIndexes(): void
-    {
-        $this->client->createIndex('index-1');
-        $this->client->createIndex('index-2');
-
-        $response = $this->client->getAllIndexes();
-
-        $this->assertCount(2, $response);
-
-        $this->client->deleteAllIndexes();
-        $response = $this->client->getAllIndexes();
-
-        $this->assertCount(0, $response);
-    }
-
-    public function testDeleteAllIndexesWhenThereAreNoIndexes(): void
-    {
-        $response = $this->client->getAllIndexes();
-        $this->assertCount(0, $response);
-
-        $this->client->deleteAllIndexes();
-
-        $this->assertCount(0, $response);
-    }
-
-    public function testGetIndex(): void
-    {
-        $this->client->createIndex('index');
-
-        $index = $this->client->getIndex('index');
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertNull($index->getPrimaryKey());
-    }
-
-    public function testIndex(): void
-    {
-        $this->client->createIndex('index');
-
-        $index = $this->client->index('index');
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertNull($index->getPrimaryKey());
-    }
-
-    public function testGetOrCreateIndexWithOnlyUid(): void
-    {
-        $index = $this->client->getOrCreateIndex('index');
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertNull($index->getPrimaryKey());
-    }
-
-    public function testGetOrCreateIndexWithUidAndPrimaryKey(): void
-    {
-        $index = $this->client->getOrCreateIndex(
-            'index',
-            ['primaryKey' => 'ObjectId']
-        );
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertSame('ObjectId', $index->getPrimaryKey());
-    }
-
-    public function testGetOrCreateIndexWithUidInOptions(): void
-    {
-        $index = $this->client->getOrCreateIndex(
-            'index',
-            [
-                'uid' => 'wrong',
-                'primaryKey' => 'ObjectId',
-            ]
-        );
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('index', $index->getUid());
-        $this->assertSame('ObjectId', $index->getPrimaryKey());
-    }
-
-    public function testGetOrCreateWithIndexAlreadyExists(): void
-    {
-        $index1 = $this->client->getOrCreateIndex('index');
-        $index2 = $this->client->getOrCreateIndex('index');
-        $index3 = $this->client->getOrCreateIndex('index');
-
-        $this->assertSame('index', $index1->getUid());
-        $this->assertSame('index', $index2->getUid());
-        $this->assertSame('index', $index3->getUid());
-
-        $update = $index1->addDocuments([['book_id' => 1, 'name' => 'Some book']]);
-        $index1->waitForPendingUpdate($update['updateId']);
-
-        $documents = $index2->getDocuments();
-        $this->assertCount(1, $documents);
-        $index2->delete();
-    }
-
-    public function testExceptionIsThrownWhenOverwritingPrimaryKeyUsingUpdateIndex(): void
-    {
-        $this->client->createIndex(
-            'indexB',
-            ['primaryKey' => 'objectId']
-        );
-
-        $this->expectException(ApiException::class);
-
-        $this->client->updateIndex('indexB', ['primaryKey' => 'objectID']);
-    }
-
-    public function testExceptionIsThrownWhenUpdateIndexUseANoneExistingIndex(): void
-    {
-        $this->expectException(ApiException::class);
-
-        $this->client->updateIndex(
-            'IndexNotExist',
-            ['primaryKey' => 'objectId']
-        );
-    }
-
-    public function testExceptionIfUidTakenWhenCreating(): void
-    {
-        $this->client->createIndex('index');
-
-        $this->expectException(ApiException::class);
-
-        $this->client->createIndex('index');
-    }
-
-    public function testExceptionIfUidIsNullWhenCreating(): void
-    {
-        $this->expectException(\TypeError::class);
-        $this->client->createIndex(null);
-    }
-
-    public function testExceptionIfUidIsEmptyStringWhenCreating(): void
-    {
-        $this->expectException(ApiException::class);
-        $this->client->createIndex('');
-    }
-
-    public function testExceptionIfNoIndexWhenShowing(): void
-    {
-        $this->expectException(ApiException::class);
-        $this->client->getIndex('a-non-existing-index');
-    }
-
-    public function testExceptionIfNoIndexWhenDeleting(): void
-    {
-        $this->expectException(ApiException::class);
-        $this->client->deleteIndex('a-non-existing-index');
-    }
-
-    public function testHealth(): void
-    {
-        $response = $this->client->health();
-
-        $this->assertEquals('available', $response['status']);
-    }
-
-    public function testIsHealthyIsTrue(): void
-    {
-        $response = $this->client->isHealthy();
-
-        $this->assertTrue($response);
-    }
-
-    public function testIsHealthyIsFalse(): void
-    {
-        $client = new Client('http://127.0.0.1.com:1234', 'masterKey');
-        $response = $client->isHealthy();
-
-        $this->assertFalse($response);
-    }
-
-    public function testVersion(): void
-    {
-        $response = $this->client->version();
-
-        $this->assertArrayHasKey('commitSha', $response);
-        $this->assertArrayHasKey('buildDate', $response);
-        $this->assertArrayHasKey('pkgVersion', $response);
-    }
-
-    public function testStats(): void
-    {
-        $response = $this->client->stats();
-
-        $this->assertArrayHasKey('databaseSize', $response);
-        $this->assertArrayHasKey('lastUpdate', $response);
-        $this->assertArrayHasKey('indexes', $response);
-    }
-
-    public function testBadClientUrl(): void
-    {
-        try {
-            $client = new Client('http://127.0.0.1.com:1234', 'some-key');
-            $client->createIndex('index');
-        } catch (\Exception $e) {
-            $this->assertIsString($e->getMessage());
-
-            return;
-        }
-        $this->fail('Bad client was accepted and the exception was not thrown');
-    }
-}

+ 0 - 318
vendor/meilisearch/meilisearch-php/tests/Endpoints/DocumentsTest.php

@@ -1,318 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Exceptions\ApiException;
-use MeiliSearch\Exceptions\InvalidArgumentException;
-use Tests\TestCase;
-
-final class DocumentsTest extends TestCase
-{
-    public function testAddDocuments(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $promise = $index->addDocuments(self::DOCUMENTS);
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $response = $index->getDocuments();
-        $this->assertCount(\count(self::DOCUMENTS), $response);
-    }
-
-    public function testGetSingleDocumentWithIntegerDocumentId(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-        $doc = $this->findDocumentWithId(self::DOCUMENTS, 4);
-        $response = $index->getDocument($doc['id']);
-
-        $this->assertIsArray($response);
-        $this->assertSame($doc['id'], $response['id']);
-        $this->assertSame($doc['title'], $response['title']);
-    }
-
-    public function testGetSingleDocumentWithStringDocumentId(): void
-    {
-        $stringDocumentId = 'myUniqueId';
-        $index = $this->client->createIndex('documents');
-        $addDocumentResponse = $index->addDocuments([['id' => $stringDocumentId]]);
-        $index->waitForPendingUpdate($addDocumentResponse['updateId']);
-        $response = $index->getDocument($stringDocumentId);
-
-        $this->assertIsArray($response);
-        $this->assertSame($stringDocumentId, $response['id']);
-    }
-
-    public function testReplaceDocuments(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-        $replacement = [
-            'id' => 2,
-            'title' => 'The Red And The Black',
-        ];
-        $response = $index->addDocuments([$replacement]);
-
-        $this->assertIsValidPromise($response);
-
-        $index->waitForPendingUpdate($response['updateId']);
-        $response = $index->getDocument($replacement['id']);
-
-        $this->assertSame($replacement['id'], $response['id']);
-        $this->assertSame($replacement['title'], $response['title']);
-        $this->assertFalse(array_search('comment', $response));
-        $response = $index->getDocuments();
-        $this->assertCount(\count(self::DOCUMENTS), $response);
-    }
-
-    public function testUpdateDocuments(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $promise = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($promise['updateId']);
-        $replacement = [
-            'id' => 456,
-            'title' => 'The Little Prince',
-        ];
-        $promise = $index->updateDocuments([$replacement]);
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $response = $index->getDocument($replacement['id']);
-
-        $this->assertSame($replacement['id'], $response['id']);
-        $this->assertSame($replacement['title'], $response['title']);
-        $this->assertArrayHasKey('comment', $response);
-
-        $response = $index->getDocuments();
-
-        $this->assertCount(\count(self::DOCUMENTS), $response);
-    }
-
-    public function testAddWithUpdateDocuments(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-        $document = [
-            'id' => 9,
-            'title' => '1984',
-        ];
-        $promise = $index->updateDocuments([$document]);
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $response = $index->getDocument($document['id']);
-
-        $this->assertSame($document['id'], $response['id']);
-        $this->assertSame($document['title'], $response['title']);
-        $this->assertFalse(array_search('comment', $response));
-
-        $response = $index->getDocuments();
-
-        $this->assertCount(\count(self::DOCUMENTS) + 1, $response);
-    }
-
-    public function testDeleteNonExistingDocument(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-
-        $documentId = 9;
-        $promise = $index->deleteDocument($documentId);
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $response = $index->getDocuments();
-
-        $this->assertCount(\count(self::DOCUMENTS), $response);
-        $this->assertNull($this->findDocumentWithId($response, $documentId));
-    }
-
-    public function testDeleteSingleExistingDocumentWithDocumentIdAsInteger(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-
-        $documentId = 123;
-        $promise = $index->deleteDocument($documentId);
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $response = $index->getDocuments();
-
-        $this->assertCount(\count(self::DOCUMENTS) - 1, $response);
-        $this->assertNull($this->findDocumentWithId($response, $documentId));
-    }
-
-    public function testDeleteSingleExistingDocumentWithDocumentIdAsString(): void
-    {
-        $stringDocumentId = 'myUniqueId';
-        $index = $this->client->createIndex('documents');
-        $addDocumentResponse = $index->addDocuments([['id' => $stringDocumentId]]);
-        $index->waitForPendingUpdate($addDocumentResponse['updateId']);
-
-        $promise = $index->deleteDocument($stringDocumentId);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $response = $index->getDocuments();
-
-        $this->assertEmpty($response);
-    }
-
-    public function testDeleteMultipleDocumentsWithDocumentIdAsInteger(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-        $documentIds = [1, 2];
-        $promise = $index->deleteDocuments($documentIds);
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $response = $index->getDocuments();
-
-        $this->assertCount(\count(self::DOCUMENTS) - 2, $response);
-        $this->assertNull($this->findDocumentWithId($response, $documentIds[0]));
-        $this->assertNull($this->findDocumentWithId($response, $documentIds[1]));
-    }
-
-    public function testDeleteMultipleDocumentsWithDocumentIdAsString(): void
-    {
-        $documents = [
-            ['id' => 'myUniqueId1'],
-            ['id' => 'myUniqueId2'],
-            ['id' => 'myUniqueId3'],
-        ];
-        $index = $this->client->createIndex('documents');
-        $addDocumentResponse = $index->addDocuments($documents);
-        $index->waitForPendingUpdate($addDocumentResponse['updateId']);
-
-        $promise = $index->deleteDocuments(['myUniqueId1', 'myUniqueId3']);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $response = $index->getDocuments();
-        $this->assertCount(1, $response);
-        $this->assertSame([['id' => 'myUniqueId2']], $response);
-    }
-
-    public function testDeleteAllDocuments(): void
-    {
-        $index = $this->client->createIndex('documents');
-        $response = $index->addDocuments(self::DOCUMENTS);
-        $index->waitForPendingUpdate($response['updateId']);
-        $promise = $index->deleteAllDocuments();
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $response = $index->getDocuments();
-
-        $this->assertCount(0, $response);
-    }
-
-    public function testExceptionIfNoDocumentIdWhenGetting(): void
-    {
-        $index = $this->client->createIndex('new-index');
-
-        $this->expectException(ApiException::class);
-
-        $index->getDocument(1);
-    }
-
-    public function testAddDocumentWithPrimaryKey(): void
-    {
-        $documents = [
-            [
-                'id' => 1,
-                'unique' => 1,
-                'title' => 'Le Rouge et le Noir',
-            ],
-        ];
-        $index = $this->client->createIndex('an-index');
-        $response = $index->addDocuments($documents, 'unique');
-
-        $this->assertArrayHasKey('updateId', $response);
-        $index->waitForPendingUpdate($response['updateId']);
-
-        $this->assertSame('unique', $index->fetchPrimaryKey());
-        $this->assertCount(1, $index->getDocuments());
-    }
-
-    public function testUpdateDocumentWithPrimaryKey(): void
-    {
-        $documents = [
-            [
-                'id' => 1,
-                'unique' => 1,
-                'title' => 'Le Rouge et le Noir',
-            ],
-        ];
-        $index = $this->client->createIndex('index');
-        $promise = $index->updateDocuments($documents, 'unique');
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $this->assertSame('unique', $index->fetchPrimaryKey());
-        $this->assertCount(1, $index->getDocuments());
-    }
-
-    /**
-     * @dataProvider invalidDocumentIds
-     */
-    public function testFetchingDocumentWithInvalidId($documentId): void
-    {
-        $index = $this->client->createIndex('an-index');
-
-        $this->expectException(InvalidArgumentException::class);
-        $index->getDocument($documentId);
-    }
-
-    /**
-     * @dataProvider invalidDocumentIds
-     */
-    public function testDeletingDocumentWithInvalidId($documentId): void
-    {
-        $index = $this->client->createIndex('an-index');
-
-        $this->expectException(InvalidArgumentException::class);
-        $index->deleteDocument($documentId);
-    }
-
-    public function invalidDocumentIds(): array
-    {
-        return [
-            'documentId as null' => [null],
-            'documentId as bool' => [true],
-            'documentId as empty string' => [''],
-            'documentId as float' => [2.1],
-            'documentId as array' => [[]],
-            'documentId as object' => [new \stdClass()],
-            'documentId as resource' => [tmpfile()],
-        ];
-    }
-
-    private function findDocumentWithId($documents, $documentId)
-    {
-        foreach ($documents as $document) {
-            if ($document['id'] == $documentId) {
-                return $document;
-            }
-        }
-    }
-}

+ 0 - 32
vendor/meilisearch/meilisearch-php/tests/Endpoints/DumpTest.php

@@ -1,32 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Exceptions\ApiException;
-use Tests\TestCase;
-
-final class DumpTest extends TestCase
-{
-    public function testCreateDumpAndGetStatus(): void
-    {
-        $dump = $this->client->createDump();
-
-        $this->assertArrayHasKey('uid', $dump);
-        $this->assertArrayHasKey('status', $dump);
-        $this->assertEquals('in_progress', $dump['status']);
-
-        $dump = $this->client->getDumpStatus($dump['uid']);
-
-        $this->assertArrayHasKey('uid', $dump);
-        $this->assertArrayHasKey('status', $dump);
-    }
-
-    public function testDumpNotFound(): void
-    {
-        $this->expectException(ApiException::class);
-
-        $this->client->getDumpStatus('not-found');
-    }
-}

+ 0 - 215
vendor/meilisearch/meilisearch-php/tests/Endpoints/IndexTest.php

@@ -1,215 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Endpoints\Indexes;
-use MeiliSearch\Exceptions\ApiException;
-use MeiliSearch\Exceptions\TimeOutException;
-use Tests\TestCase;
-
-final class IndexTest extends TestCase
-{
-    private $index;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-    }
-
-    public function testGetPrimaryKey(): void
-    {
-        $indexB = $this->client->createIndex(
-            'indexB',
-            ['primaryKey' => 'objectId']
-        );
-
-        $this->assertNull($this->index->getPrimaryKey());
-        $this->assertSame('objectId', $indexB->getPrimaryKey());
-    }
-
-    public function testGetUid(): void
-    {
-        $indexB = $this->client->createIndex(
-            'indexB',
-            ['primaryKey' => 'objectId']
-        );
-        $this->assertSame('index', $this->index->getUid());
-        $this->assertSame('indexB', $indexB->getUid());
-    }
-
-    public function testfetchRawInfo(): void
-    {
-        $index = $this->client->createIndex(
-            'indexB',
-            ['primaryKey' => 'objectId']
-        );
-
-        $response = $index->fetchRawInfo();
-
-        $this->assertArrayHasKey('primaryKey', $response);
-        $this->assertArrayHasKey('uid', $response);
-        $this->assertArrayHasKey('createdAt', $response);
-        $this->assertArrayHasKey('updatedAt', $response);
-        $this->assertSame($response['primaryKey'], 'objectId');
-        $this->assertSame($response['uid'], 'indexB');
-    }
-
-    public function testPrimaryKeyUpdate(): void
-    {
-        $primaryKey = 'id';
-
-        $index = $this->index->update(['primaryKey' => $primaryKey]);
-
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame($index->getPrimaryKey(), $primaryKey);
-        $this->assertSame($index->getUid(), 'index');
-        $this->assertSame($this->index->getPrimaryKey(), $primaryKey);
-        $this->assertSame($this->index->getUid(), 'index');
-    }
-
-    public function testExceptionIsThrownWhenOverwritingPrimaryKey(): void
-    {
-        $index = $this->client->createIndex(
-            'indexB',
-            ['primaryKey' => 'objectId']
-        );
-
-        $this->expectException(ApiException::class);
-
-        $index->update(['primaryKey' => 'objectID']);
-    }
-
-    public function testIndexStats(): void
-    {
-        $stats = $this->index->stats();
-
-        $this->assertArrayHasKey('numberOfDocuments', $stats);
-        $this->assertEquals(0, $stats['numberOfDocuments']);
-        $this->assertArrayHasKey('isIndexing', $stats);
-        $this->assertArrayHasKey('fieldsDistribution', $stats);
-    }
-
-    public function testFetchInfo(): void
-    {
-        $uid = 'indexA';
-        $this->client->createIndex(
-            $uid,
-            ['primaryKey' => 'objectID']
-        );
-
-        $index = $this->client->index($uid);
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertNull($index->getPrimaryKey());
-
-        $index = $index->fetchInfo();
-        $this->assertInstanceOf(Indexes::class, $index);
-        $this->assertSame('objectID', $index->getPrimaryKey());
-    }
-
-    public function testGetAndFetchPrimaryKey(): void
-    {
-        $uid = 'indexA';
-        $this->client->createIndex(
-            $uid,
-            ['primaryKey' => 'objectID']
-        );
-
-        $index = $this->client->index($uid);
-        $this->assertNull($index->getPrimaryKey());
-        $this->assertSame('objectID', $index->fetchPrimaryKey());
-        $this->assertSame('objectID', $index->getPrimaryKey());
-    }
-
-    public function testWaitForPendingUpdateDefault(): void
-    {
-        $promise = $this->index->addDocuments([['id' => 1, 'title' => 'Pride and Prejudice']]);
-
-        $response = $this->index->waitForPendingUpdate($promise['updateId']);
-
-        $this->assertIsArray($response);
-        $this->assertSame($response['status'], 'processed');
-        $this->assertSame($response['updateId'], $promise['updateId']);
-        $this->assertArrayHasKey('type', $response);
-        $this->assertIsArray($response['type']);
-        $this->assertArrayHasKey('duration', $response);
-        $this->assertArrayHasKey('enqueuedAt', $response);
-        $this->assertArrayHasKey('processedAt', $response);
-    }
-
-    public function testWaitForPendingUpdateWithTimeoutAndInterval(): void
-    {
-        $promise = $this->index->addDocuments([['id' => 1, 'title' => 'Pride and Prejudice']]);
-        $response = $this->index->waitForPendingUpdate($promise['updateId'], 100, 20);
-
-        $this->assertIsArray($response);
-        $this->assertSame($response['status'], 'processed');
-        $this->assertSame($response['updateId'], $promise['updateId']);
-        $this->assertArrayHasKey('type', $response);
-        $this->assertIsArray($response['type']);
-        $this->assertArrayHasKey('duration', $response);
-        $this->assertArrayHasKey('enqueuedAt', $response);
-        $this->assertArrayHasKey('processedAt', $response);
-    }
-
-    public function testWaitForPendingUpdateWithTimeout(): void
-    {
-        $promise = $this->index->addDocuments([['id' => 1, 'title' => 'Pride and Prejudice']]);
-        $response = $this->index->waitForPendingUpdate($promise['updateId'], 100);
-
-        $this->assertIsArray($response);
-        $this->assertSame($response['status'], 'processed');
-        $this->assertSame($response['updateId'], $promise['updateId']);
-        $this->assertArrayHasKey('type', $response);
-        $this->assertIsArray($response['type']);
-        $this->assertArrayHasKey('duration', $response);
-        $this->assertArrayHasKey('enqueuedAt', $response);
-        $this->assertArrayHasKey('processedAt', $response);
-    }
-
-    public function testExceptionWhenPendingUpdateTimeOut(): void
-    {
-        $this->expectException(TimeOutException::class);
-        $res = $this->index->addDocuments([['id' => 1, 'title' => 'Pride and Prejudice']]);
-        $this->index->waitForPendingUpdate($res['updateId'], 0, 20);
-    }
-
-    public function testDeleteIndexes(): void
-    {
-        $this->index = $this->client->createIndex('indexA');
-        $indexB = $this->client->createIndex('indexB');
-
-        $res = $this->index->delete();
-        $this->assertEmpty($res);
-
-        $res = $indexB->delete();
-        $this->assertEmpty($res);
-    }
-
-    public function testExceptionIsThrownIfNoIndexWhenShowing(): void
-    {
-        $this->index->delete();
-
-        $this->expectException(ApiException::class);
-
-        $this->index->fetchInfo();
-    }
-
-    public function testExceptionIsThrownIfNoIndexWhenUpdating(): void
-    {
-        $this->index->delete();
-
-        $this->expectException(ApiException::class);
-        $this->index->update(['primaryKey' => 'objectID']);
-    }
-
-    public function testExceptionIsThrownIfNoIndexWhenDeleting(): void
-    {
-        $this->index->delete();
-
-        $this->expectException(ApiException::class);
-        $this->index->delete();
-    }
-}

+ 0 - 74
vendor/meilisearch/meilisearch-php/tests/Endpoints/KeysAndPermissionsTest.php

@@ -1,74 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Client;
-use MeiliSearch\Exceptions\ApiException;
-use Tests\TestCase;
-
-final class KeysAndPermissionsTest extends TestCase
-{
-    public function testGetKeys(): void
-    {
-        $response = $this->client->getKeys();
-
-        $this->assertArrayHasKey('private', $response);
-        $this->assertArrayHasKey('public', $response);
-        $this->assertIsString($response['private']);
-        $this->assertNotNull($response['private']);
-        $this->assertIsString($response['public']);
-        $this->assertNotNull($response['public']);
-    }
-
-    public function testSearchingIfPublicKeyProvided(): void
-    {
-        $this->client->createIndex('index');
-
-        $newClient = new Client(self::HOST, $this->getKeys()['public']);
-        $response = $newClient->index('index')->search('test');
-        $this->assertArrayHasKey('hits', $response->toArray());
-    }
-
-    public function testGetSettingsIfPrivateKeyProvided(): void
-    {
-        $this->client->createIndex('index');
-        $newClient = new Client(self::HOST, $this->getKeys()['private']);
-        $response = $newClient->index('index')->getSettings();
-
-        $this->assertEquals(['*'], $response['searchableAttributes']);
-    }
-
-    public function testExceptionIfNoMasterKeyProvided(): void
-    {
-        $newClient = new Client(self::HOST);
-
-        $this->expectException(ApiException::class);
-        $newClient->index('index')->search('test');
-    }
-
-    public function testExceptionIfBadKeyProvidedToGetSettings(): void
-    {
-        $this->client->createIndex('index');
-        $response = $this->client->index('index')->getSettings();
-        $this->assertEquals(['*'], $response['searchableAttributes']);
-
-        $newClient = new Client(self::HOST, 'bad-key');
-
-        $this->expectException(ApiException::class);
-        $newClient->index('index')->getSettings();
-    }
-
-    public function testExceptionIfBadKeyProvidedToGetKeys(): void
-    {
-        $this->expectException(ApiException::class);
-        $client = new Client(self::HOST, 'bad-key');
-        $client->getKeys();
-    }
-
-    private function getKeys(): array
-    {
-        return $this->client->getKeys();
-    }
-}

+ 0 - 605
vendor/meilisearch/meilisearch-php/tests/Endpoints/SearchTest.php

@@ -1,605 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Exceptions\ApiException;
-use Tests\TestCase;
-
-final class SearchTest extends TestCase
-{
-    private $index;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-        $promise = $this->index->updateDocuments(self::DOCUMENTS);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-    }
-
-    public function testBasicSearch(): void
-    {
-        $response = $this->index->search('prince');
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertSame(2, $response->getNbHits());
-        $this->assertCount(2, $response->getHits());
-
-        $response = $this->index->search('prince', [], [
-            'raw' => true,
-        ]);
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(2, $response['nbHits']);
-    }
-
-    public function testBasicEmptySearch(): void
-    {
-        $response = $this->index->search('');
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertCount(7, $response->getHits());
-
-        $response = $this->index->search('', [], [
-            'raw' => true,
-        ]);
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(7, $response['nbHits']);
-    }
-
-    public function testBasicPlaceholderSearch(): void
-    {
-        $response = $this->index->search(null);
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertCount(\count(self::DOCUMENTS), $response->getHits());
-
-        $response = $this->index->search(null, [], [
-            'raw' => true,
-        ]);
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(\count(self::DOCUMENTS), $response['nbHits']);
-    }
-
-    public function testSearchWithOptions(): void
-    {
-        $response = $this->index->search('prince', ['limit' => 1]);
-
-        $this->assertCount(1, $response->getHits());
-
-        $response = $this->index->search('prince', ['limit' => 1], [
-            'raw' => true,
-        ]);
-
-        $this->assertSame(1, \count($response['hits']));
-    }
-
-    public function testBasicSearchIfNoPrimaryKeyAndDocumentProvided(): void
-    {
-        $emptyIndex = $this->client->createIndex('empty');
-
-        $res = $emptyIndex->search('prince');
-
-        $this->assertArrayHasKey('hits', $res->toArray());
-        $this->assertArrayHasKey('offset', $res->toArray());
-        $this->assertArrayHasKey('limit', $res->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $res->toArray());
-        $this->assertArrayHasKey('query', $res->toArray());
-        $this->assertCount(0, $res->getHits());
-
-        $res = $emptyIndex->search('prince', [], [
-            'raw' => true,
-        ]);
-
-        $this->assertArrayHasKey('hits', $res);
-        $this->assertArrayHasKey('offset', $res);
-        $this->assertArrayHasKey('limit', $res);
-        $this->assertArrayHasKey('processingTimeMs', $res);
-        $this->assertArrayHasKey('query', $res);
-        $this->assertSame(0, $res['nbHits']);
-    }
-
-    public function testExceptionIfNoIndexWhenSearching(): void
-    {
-        $index = $this->client->createIndex('another-index');
-        $index->delete();
-
-        $this->expectException(ApiException::class);
-
-        $index->search('prince');
-    }
-
-    public function testParametersArray(): void
-    {
-        $response = $this->index->search('prince', [
-            'limit' => 5,
-            'offset' => 0,
-            'attributesToRetrieve' => ['id', 'title'],
-            'attributesToCrop' => ['id', 'title'],
-            'cropLength' => 6,
-            'attributesToHighlight' => ['title'],
-            'filters' => 'title = "Le Petit Prince"',
-            'matches' => true,
-        ]);
-
-        $this->assertArrayHasKey('_matchesInfo', $response->getHit(0));
-        $this->assertArrayHasKey('title', $response->getHit(0)['_matchesInfo']);
-        $this->assertArrayHasKey('_formatted', $response->getHit(0));
-        $this->assertArrayNotHasKey('comment', $response->getHit(0));
-        $this->assertArrayNotHasKey('comment', $response->getHit(0)['_matchesInfo']);
-        $this->assertSame('Petit <em>Prince</em>', $response->getHit(0)['_formatted']['title']);
-
-        $response = $this->index->search('prince', [
-            'limit' => 5,
-            'offset' => 0,
-            'attributesToRetrieve' => ['id', 'title'],
-            'attributesToCrop' => ['id', 'title'],
-            'cropLength' => 6,
-            'attributesToHighlight' => ['title'],
-            'filters' => 'title = "Le Petit Prince"',
-            'matches' => true,
-        ], [
-            'raw' => true,
-        ]);
-
-        $this->assertArrayHasKey('_matchesInfo', $response['hits'][0]);
-        $this->assertArrayHasKey('title', $response['hits'][0]['_matchesInfo']);
-        $this->assertArrayHasKey('_formatted', $response['hits'][0]);
-        $this->assertArrayNotHasKey('comment', $response['hits'][0]);
-        $this->assertArrayNotHasKey('comment', $response['hits'][0]['_matchesInfo']);
-        $this->assertSame('Petit <em>Prince</em>', $response['hits'][0]['_formatted']['title']);
-    }
-
-    public function testParametersCanBeAStar(): void
-    {
-        $response = $this->index->search('prince', [
-            'limit' => 5,
-            'offset' => 0,
-            'attributesToRetrieve' => ['*'],
-            'attributesToCrop' => ['*'],
-            'cropLength' => 6,
-            'attributesToHighlight' => ['*'],
-            'filters' => 'title = "Le Petit Prince"',
-            'matches' => true,
-        ]);
-
-        $this->assertArrayHasKey('_matchesInfo', $response->getHit(0));
-        $this->assertArrayHasKey('title', $response->getHit(0)['_matchesInfo']);
-        $this->assertArrayHasKey('_formatted', $response->getHit(0));
-        $this->assertArrayHasKey('comment', $response->getHit(0));
-        $this->assertArrayNotHasKey('comment', $response->getHit(0)['_matchesInfo']);
-        $this->assertSame('Petit <em>Prince</em>', $response->getHit(0)['_formatted']['title']);
-
-        $response = $this->index->search('prince', [
-            'limit' => 5,
-            'offset' => 0,
-            'attributesToRetrieve' => ['*'],
-            'attributesToCrop' => ['*'],
-            'cropLength' => 6,
-            'attributesToHighlight' => ['*'],
-            'filters' => 'title = "Le Petit Prince"',
-            'matches' => true,
-        ], [
-            'raw' => true,
-        ]);
-
-        $this->assertArrayHasKey('_matchesInfo', $response['hits'][0]);
-        $this->assertArrayHasKey('title', $response['hits'][0]['_matchesInfo']);
-        $this->assertArrayHasKey('_formatted', $response['hits'][0]);
-        $this->assertArrayHasKey('comment', $response['hits'][0]);
-        $this->assertArrayNotHasKey('comment', $response['hits'][0]['_matchesInfo']);
-        $this->assertSame('Petit <em>Prince</em>', $response['hits'][0]['_formatted']['title']);
-    }
-
-    public function testBasicSearchWithFacetsDistribution(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $response = $this->index->search('prince', [
-            'facetsDistribution' => ['genre'],
-        ]);
-        $this->assertSame(2, $response->getHitsCount());
-        $this->assertArrayHasKey('facetsDistribution', $response->toArray());
-        $this->assertArrayHasKey('exhaustiveFacetsCount', $response->toArray());
-        $this->assertArrayHasKey('genre', $response->getFacetsDistribution());
-        $this->assertTrue($response->getExhaustiveFacetsCount());
-        $this->assertSame($response->getFacetsDistribution()['genre']['fantasy'], 1);
-        $this->assertSame($response->getFacetsDistribution()['genre']['adventure'], 1);
-        $this->assertSame($response->getFacetsDistribution()['genre']['romance'], 0);
-
-        $response = $this->index->search('prince', [
-            'facetsDistribution' => ['genre'],
-        ], [
-            'raw' => true,
-        ]);
-        $this->assertSame(2, $response['nbHits']);
-        $this->assertArrayHasKey('facetsDistribution', $response);
-        $this->assertArrayHasKey('exhaustiveFacetsCount', $response);
-        $this->assertArrayHasKey('genre', $response['facetsDistribution']);
-        $this->assertTrue($response['exhaustiveFacetsCount']);
-        $this->assertSame($response['facetsDistribution']['genre']['fantasy'], 1);
-        $this->assertSame($response['facetsDistribution']['genre']['adventure'], 1);
-        $this->assertSame($response['facetsDistribution']['genre']['romance'], 0);
-    }
-
-    public function testBasicSearchWithFacetFilters(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $response = $this->index->search('prince', [
-            'facetFilters' => [['genre:fantasy']],
-        ]);
-        $this->assertSame(1, $response->getHitsCount());
-        $this->assertArrayNotHasKey('facetsDistribution', $response->getRaw());
-        $this->assertArrayNotHasKey('exhaustiveFacetsCount', $response->getRaw());
-        $this->assertSame(4, $response->getHit(0)['id']);
-
-        $response = $this->index->search('prince', [
-            'facetFilters' => [['genre:fantasy']],
-        ], [
-            'raw' => true,
-        ]);
-        $this->assertSame(1, $response['nbHits']);
-        $this->assertArrayNotHasKey('facetsDistribution', $response);
-        $this->assertArrayNotHasKey('exhaustiveFacetsCount', $response);
-        $this->assertSame(4, $response['hits'][0]['id']);
-    }
-
-    public function testBasicSearchWithMultipleFacetFilters(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $response = $this->index->search('prince', [
-            'facetFilters' => ['genre:fantasy', ['genre:fantasy', 'genre:fantasy']],
-        ]);
-        $this->assertSame(1, $response->getHitsCount());
-        $this->assertArrayNotHasKey('facetsDistribution', $response->getRaw());
-        $this->assertArrayNotHasKey('exhaustiveFacetsCount', $response->getRaw());
-        $this->assertSame(4, $response->getHit(0)['id']);
-
-        $response = $this->index->search('prince', [
-            'facetFilters' => ['genre:fantasy', ['genre:fantasy', 'genre:fantasy']],
-        ], [
-            'raw' => true,
-        ]);
-        $this->assertSame(1, $response['nbHits']);
-        $this->assertArrayNotHasKey('facetsDistribution', $response);
-        $this->assertArrayNotHasKey('exhaustiveFacetsCount', $response);
-        $this->assertSame(4, $response['hits'][0]['id']);
-    }
-
-    public function testCustomSearchWithFacetFiltersAndAttributesToRetrieve(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $response = $this->index->search('prince', [
-            'facetFilters' => [['genre:fantasy']],
-            'attributesToRetrieve' => ['id', 'title'],
-        ]);
-        $this->assertSame(1, $response->getHitsCount());
-        $this->assertArrayNotHasKey('facetsDistribution', $response->getRaw());
-        $this->assertArrayNotHasKey('exhaustiveFacetsCount', $response->getRaw());
-        $this->assertSame(4, $response->getHit(0)['id']);
-        $this->assertArrayHasKey('id', $response->getHit(0));
-        $this->assertArrayHasKey('title', $response->getHit(0));
-        $this->assertArrayNotHasKey('comment', $response->getHit(0));
-
-        $response = $this->index->search('prince', [
-            'facetFilters' => [['genre:fantasy']],
-            'attributesToRetrieve' => ['id', 'title'],
-        ], [
-            'raw' => true,
-        ]);
-        $this->assertSame(1, $response['nbHits']);
-        $this->assertArrayNotHasKey('facetsDistribution', $response);
-        $this->assertArrayNotHasKey('exhaustiveFacetsCount', $response);
-        $this->assertSame(4, $response['hits'][0]['id']);
-        $this->assertArrayHasKey('id', $response['hits'][0]);
-        $this->assertArrayHasKey('title', $response['hits'][0]);
-        $this->assertArrayNotHasKey('comment', $response['hits'][0]);
-    }
-
-    public function testBasicSerachWithRawSearch(): void
-    {
-        $response = $this->index->rawSearch('prince');
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(2, $response['nbHits']);
-        $this->assertCount(2, $response['hits']);
-        $this->assertEquals('Le Petit Prince', $response['hits'][0]['title']);
-    }
-
-    public function testBasicSearchWithRawOption(): void
-    {
-        $response = $this->index->search('prince', [], ['raw' => true]);
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(2, $response['nbHits']);
-        $this->assertCount(2, $response['hits']);
-    }
-
-    public function testBasicSearchWithTransformHitsOptionToFilter(): void
-    {
-        $keepLePetitPrinceFunc = function (array $hits) {
-            return array_filter(
-                $hits,
-                function (array $hit) { return 'Le Petit Prince' === $hit['title']; }
-            );
-        };
-
-        $response = $this->index->search('prince', [], $options = ['transformHits' => $keepLePetitPrinceFunc]);
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertSame('Le Petit Prince', $response->getHit(0)['title']);
-        $this->assertSame(2, $response->getNbHits());
-        $this->assertSame(1, $response->getHitsCount());
-        $this->assertSame(1, $response->count());
-    }
-
-    public function testBasicSearchWithTransformHitsOptionToMap(): void
-    {
-        $titlesToUpperCaseFunc = function (array $hits) {
-            return array_map(
-                function (array $hit) {
-                    $hit['title'] = strtoupper($hit['title']);
-
-                    return $hit;
-                },
-                $hits
-            );
-        };
-
-        $response = $this->index->search('prince', [], ['transformHits' => $titlesToUpperCaseFunc]);
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertSame(2, $response->getNbHits());
-        $this->assertSame(2, $response->getHitsCount());
-        $this->assertCount(2, $response->getHits());
-        $this->assertSame('LE PETIT PRINCE', $response->getHits()[0]['title']);
-    }
-
-    public function testBasicSearchCannotBeFilteredOnRawResult(): void
-    {
-        $keepLePetitPrinceFunc = function (array $hits) {
-            return array_filter(
-                $hits,
-                function (array $hit) { return 'Le Petit Prince' === $hit['title']; }
-            );
-        };
-
-        $response = $this->index->search('prince', [], [
-            'raw' => true,
-            'transformHits' => $keepLePetitPrinceFunc,
-        ]);
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(2, $response['nbHits']);
-        $this->assertCount(2, $response['hits']);
-    }
-
-    public function testBasicSearchCanBeFilteredOnRawResultIfUsingToArray(): void
-    {
-        $keepLePetitPrinceFunc = function (array $hits) {
-            return array_filter(
-                $hits,
-                function (array $hit) { return 'Le Petit Prince' === $hit['title']; }
-            );
-        };
-
-        $response = $this->index->search('prince', [], ['transformHits' => $keepLePetitPrinceFunc])->toArray();
-
-        $this->assertArrayHasKey('hits', $response);
-        $this->assertArrayHasKey('offset', $response);
-        $this->assertArrayHasKey('limit', $response);
-        $this->assertArrayHasKey('processingTimeMs', $response);
-        $this->assertArrayHasKey('query', $response);
-        $this->assertSame(2, $response['nbHits']);
-        $this->assertCount(1, $response['hits']);
-        $this->assertEquals('Le Petit Prince', $response['hits'][0]['title']);
-    }
-
-    public function testBasicSearchWithRemoveZeroFacetsOption(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $response = $this->index->search(
-            'prince',
-            ['facetsDistribution' => ['genre']],
-            ['removeZeroFacets' => true]
-        );
-
-        $this->assertCount(2, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['adventure']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['fantasy']);
-        $this->assertCount(3, $response->getRaw()['facetsDistribution']['genre']);
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertNotEquals($response->getRaw()['facetsDistribution'], $response->getFacetsDistribution());
-    }
-
-    public function testBasicSearchWithRemoveZeroFacetsOptionAndMultipleFacets(): void
-    {
-        $response = $this->index->addDocuments([['id' => 32, 'title' => 'The Witcher', 'genre' => 'adventure', 'adaptation' => 'video game']]);
-        $this->index->waitForPendingUpdate($response['updateId']);
-        $response = $this->index->updateAttributesForFaceting(['genre', 'adaptation']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $response = $this->index->search(
-            'prince',
-            ['facetsDistribution' => ['genre', 'adaptation']],
-            ['removeZeroFacets' => true]
-        );
-
-        $this->assertCount(2, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['adventure']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['fantasy']);
-        $this->assertEquals([], $response->getFacetsDistribution()['adaptation']);
-        $this->assertCount(1, $response->getRaw()['facetsDistribution']['adaptation']);
-        $this->assertCount(3, $response->getRaw()['facetsDistribution']['genre']);
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertNotEquals($response->getRaw()['facetsDistribution'], $response->getFacetsDistribution());
-    }
-
-    public function testBasicSearchWithTransformFacetsDritributionOptionToFilter(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $filterAllFacets = function (array $facets) {
-            $filterOneFacet = function (array $facet) {
-                return array_filter(
-                    $facet,
-                    function ($v, $k) { return $v > 1; },
-                    ARRAY_FILTER_USE_BOTH
-                );
-            };
-
-            return array_map($filterOneFacet, $facets);
-        };
-
-        $response = $this->index->search(
-            null,
-            ['facetsDistribution' => ['genre']],
-            ['transformFacetsDistribution' => $filterAllFacets]
-        );
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('facetsDistribution', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertNotEquals($response->getRaw()['facetsDistribution'], $response->getFacetsDistribution());
-        $this->assertCount(3, $response->getRaw()['facetsDistribution']['genre']);
-        $this->assertCount(2, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(3, $response->getFacetsDistribution()['genre']['romance']);
-        $this->assertEquals(2, $response->getFacetsDistribution()['genre']['fantasy']);
-    }
-
-    public function testBasicSearchWithTransformFacetsDritributionOptionToMap(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $facetsToUpperFunc = function (array $facets) {
-            $changeOneFacet = function (array $facet) {
-                $result = [];
-                foreach ($facet as $k => $v) {
-                    $result[strtoupper($k)] = $v;
-                }
-
-                return $result;
-            };
-
-            return array_map($changeOneFacet, $facets);
-        };
-
-        $response = $this->index->search(
-            null,
-            ['facetsDistribution' => ['genre']],
-            ['transformFacetsDistribution' => $facetsToUpperFunc]
-        );
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('facetsDistribution', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertNotEquals($response->getRaw()['facetsDistribution'], $response->getFacetsDistribution());
-        $this->assertCount(3, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(3, $response->getFacetsDistribution()['genre']['ROMANCE']);
-        $this->assertEquals(2, $response->getFacetsDistribution()['genre']['FANTASY']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['ADVENTURE']);
-    }
-
-    public function testBasicSearchWithTransformFacetsDritributionOptionToOder(): void
-    {
-        $response = $this->index->updateAttributesForFaceting(['genre']);
-        $this->index->waitForPendingUpdate($response['updateId']);
-
-        $facetsToUpperFunc = function (array $facets) {
-            $sortOneFacet = function (array $facet) {
-                ksort($facet);
-
-                return $facet;
-            };
-
-            return array_map($sortOneFacet, $facets);
-        };
-
-        $response = $this->index->search(
-            null,
-            ['facetsDistribution' => ['genre']],
-            ['transformFacetsDistribution' => $facetsToUpperFunc]
-        );
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('facetsDistribution', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertEquals('adventure', array_key_first($response->getFacetsDistribution()['genre']));
-        $this->assertEquals('romance', array_key_last($response->getFacetsDistribution()['genre']));
-        $this->assertCount(3, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(3, $response->getFacetsDistribution()['genre']['romance']);
-        $this->assertEquals(2, $response->getFacetsDistribution()['genre']['fantasy']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['adventure']);
-    }
-}

+ 0 - 63
vendor/meilisearch/meilisearch-php/tests/Endpoints/UpdatesTest.php

@@ -1,63 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Endpoints;
-
-use MeiliSearch\Exceptions\ApiException;
-use Tests\TestCase;
-
-final class UpdatesTest extends TestCase
-{
-    private $index;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-    }
-
-    public function testGetOneUpdate(): void
-    {
-        [$promise, $response] = $this->seedIndex();
-
-        $this->assertIsArray($response);
-        $this->assertSame($response['status'], 'processed');
-        $this->assertSame($response['updateId'], $promise['updateId']);
-        $this->assertArrayHasKey('type', $response);
-        $this->assertIsArray($response['type']);
-        $this->assertArrayHasKey('duration', $response);
-        $this->assertArrayHasKey('enqueuedAt', $response);
-        $this->assertArrayHasKey('processedAt', $response);
-    }
-
-    public function testGetAllUpdates(): void
-    {
-        $this->seedIndex();
-
-        $response = $this->index->getAllUpdateStatus();
-
-        $this->assertCount(1, $response);
-        $this->assertSame('processed', $response[0]['status']);
-        $this->assertArrayHasKey('updateId', $response[0]);
-        $this->assertArrayHasKey('type', $response[0]);
-        $this->assertIsArray($response[0]['type']);
-        $this->assertArrayHasKey('duration', $response[0]);
-        $this->assertArrayHasKey('enqueuedAt', $response[0]);
-        $this->assertArrayHasKey('processedAt', $response[0]);
-    }
-
-    public function testExceptionIfNoUpdateIdWhenGetting(): void
-    {
-        $this->expectException(ApiException::class);
-        $this->index->getUpdateStatus(10000);
-    }
-
-    private function seedIndex(): array
-    {
-        $promise = $this->index->updateDocuments(self::DOCUMENTS);
-        $response = $this->index->waitForPendingUpdate($promise['updateId']);
-
-        return [$promise, $response];
-    }
-}

+ 0 - 36
vendor/meilisearch/meilisearch-php/tests/Exceptions/ApiExceptionTest.php

@@ -1,36 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Exceptions;
-
-use MeiliSearch\Exceptions\ApiException;
-use Tests\TestCase;
-
-final class ApiExceptionTest extends TestCase
-{
-    public function testException(): void
-    {
-        $httpBodyExample = [
-            'message' => 'This is the message',
-            'errorCode' => 'this_is_the_error_code',
-            'errorType' => 'this_is_the_error_type',
-            'errorLink' => 'https://docs.meilisearch.com/errors',
-        ];
-        $statusCode = 400;
-
-        try {
-            throw new ApiException($statusCode, $httpBodyExample);
-        } catch (ApiException $apiException) {
-            $this->assertEquals($statusCode, $apiException->httpStatus);
-            $this->assertEquals($httpBodyExample['message'],
-                $apiException->message);
-            $this->assertEquals($httpBodyExample['errorCode'], $apiException->errorCode);
-            $this->assertEquals($httpBodyExample['errorType'], $apiException->errorType);
-            $this->assertEquals($httpBodyExample['errorLink'], $apiException->errorLink);
-
-            $expectedExceptionToString = "MeiliSearch HTTPRequestException: Http Status: {$statusCode} - Message: {$httpBodyExample['message']} - Error code: {$httpBodyExample['errorCode']} - Error type: {$httpBodyExample['errorType']} - Error link: {$httpBodyExample['errorLink']}";
-            $this->assertEquals($expectedExceptionToString, (string) $apiException);
-        }
-    }
-}

+ 0 - 20
vendor/meilisearch/meilisearch-php/tests/Http/ClientTest.php

@@ -1,20 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Http;
-
-use MeiliSearch\Client;
-use MeiliSearch\Exceptions\CommunicationException;
-use Tests\TestCase;
-
-class ClientTest extends TestCase
-{
-    public function testThrowCommunicationException(): void
-    {
-        $client = new Client('http://wrongurl:1234');
-
-        $this->expectException(CommunicationException::class);
-        $client->createIndex('some_index');
-    }
-}

+ 0 - 227
vendor/meilisearch/meilisearch-php/tests/Search/SearchResultTest.php

@@ -1,227 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Search;
-
-use MeiliSearch\Search\SearchResult;
-use PHPUnit\Framework\TestCase;
-use function strtoupper;
-
-final class SearchResultTest extends TestCase
-{
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->basicServerResponse = [
-            'hits' => [
-                [
-                    'id' => '1',
-                    'title' => 'American Pie 2',
-                    'poster' => 'https://image.tmdb.org/t/p/w1280/q4LNgUnRfltxzp3gf1MAGiK5LhV.jpg',
-                    'overview' => 'The whole gang are back and as close as ever. They decide to get even closer by spending the summer together at a beach house. They decide to hold the biggest...',
-                    'release_date' => 997405200,
-                ],
-                [
-                    'id' => '190859',
-                    'title' => 'American Sniper',
-                    'poster' => 'https://image.tmdb.org/t/p/w1280/svPHnYE7N5NAGO49dBmRhq0vDQ3.jpg',
-                    'overview' => 'U.S. Navy SEAL Chris Kyle takes his sole mission—protect his comrades—to heart and becomes one of the most lethal snipers in American history. His pinpoint accuracy not only saves countless lives but also makes him a prime...',
-                    'release_date' => 1418256000,
-                ],
-            ],
-            'offset' => 0,
-            'limit' => 20,
-            'nbHits' => 976,
-            'exhaustiveNbHits' => false,
-            'processingTimeMs' => 35,
-            'query' => 'american',
-        ];
-        $this->basicResult = new SearchResult($this->basicServerResponse);
-        $this->serverResponseWithFacets = [
-            'hits' => [
-                [
-                    'genre' => 'adventure',
-                    'id' => 456,
-                    'title' => 'Le Petit Prince',
-                    'author' => 'Antoine de Saint-Exupéry',
-                ],
-                [
-                    'genre' => 'fantasy',
-                    'id' => 4,
-                    'title' => 'Harry Potter and the Half-Blood Prince',
-                    'author' => 'J. K. Rowling',
-                ],
-            ],
-            'offset' => 0,
-            'limit' => 20,
-            'nbHits' => 2,
-            'exhaustiveNbHits' => false,
-            'processingTimeMs' => 1,
-            'query' => 'prinec',
-            'facetsDistribution' => [
-                'genre' => [
-                    'fantasy' => 1,
-                    'romance' => 0,
-                    'adventure' => 1,
-                ],
-            ],
-            'exhaustiveFacetsCount' => true,
-        ];
-        $this->resultWithFacets = new SearchResult($this->serverResponseWithFacets);
-    }
-
-    public function testResultCanBeBuilt(): void
-    {
-        $this->assertSame(2, $this->basicResult->count());
-        $this->assertNotEmpty($this->basicResult->getHits());
-
-        $this->assertEquals([
-            'id' => '1',
-            'title' => 'American Pie 2',
-            'poster' => 'https://image.tmdb.org/t/p/w1280/q4LNgUnRfltxzp3gf1MAGiK5LhV.jpg',
-            'overview' => 'The whole gang are back and as close as ever. They decide to get even closer by spending the summer together at a beach house. They decide to hold the biggest...',
-            'release_date' => 997405200,
-        ], $this->basicResult->getHit(0));
-        $this->assertEquals([
-            'id' => '190859',
-            'title' => 'American Sniper',
-            'poster' => 'https://image.tmdb.org/t/p/w1280/svPHnYE7N5NAGO49dBmRhq0vDQ3.jpg',
-            'overview' => 'U.S. Navy SEAL Chris Kyle takes his sole mission—protect his comrades—to heart and becomes one of the most lethal snipers in American history. His pinpoint accuracy not only saves countless lives but also makes him a prime...',
-            'release_date' => 1418256000,
-        ], $this->basicResult->getHit(1));
-        $this->assertNull($this->basicResult->getHit(2));
-        $this->assertSame(0, $this->basicResult->getOffset());
-        $this->assertSame(20, $this->basicResult->getLimit());
-        $this->assertSame(2, $this->basicResult->getHitsCount());
-        $this->assertSame(976, $this->basicResult->getNbHits());
-        $this->assertFalse($this->basicResult->getExhaustiveNbHits());
-        $this->assertSame(35, $this->basicResult->getProcessingTimeMs());
-        $this->assertSame('american', $this->basicResult->getQuery());
-        $this->assertNull($this->basicResult->getExhaustiveFacetsCount());
-        $this->assertEmpty($this->basicResult->getFacetsDistribution());
-        $this->assertSame(2, $this->basicResult->getIterator()->count());
-
-        $this->assertArrayHasKey('hits', $this->basicResult->toArray());
-        $this->assertArrayHasKey('offset', $this->basicResult->toArray());
-        $this->assertArrayHasKey('limit', $this->basicResult->toArray());
-        $this->assertArrayHasKey('nbHits', $this->basicResult->toArray());
-        $this->assertArrayHasKey('hitsCount', $this->basicResult->toArray());
-        $this->assertArrayHasKey('exhaustiveNbHits', $this->basicResult->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $this->basicResult->toArray());
-        $this->assertArrayHasKey('query', $this->basicResult->toArray());
-        $this->assertArrayHasKey('exhaustiveFacetsCount', $this->basicResult->toArray());
-        $this->assertArrayHasKey('facetsDistribution', $this->basicResult->toArray());
-    }
-
-    public function testSearchResultCanBeFiltered(): void
-    {
-        $keepAmericanSniperFunc = function (array $hits) {
-            return array_filter(
-                $hits,
-                function (array $hit) { return 'American Sniper' === $hit['title']; }
-            );
-        };
-
-        $options = ['transformHits' => $keepAmericanSniperFunc];
-
-        $filteredResults = $this->basicResult->applyOptions($options);
-
-        $this->assertSame(1, $filteredResults->count());
-        $this->assertSame(1, $filteredResults->getHitsCount());
-        $this->assertSame(976, $filteredResults->getNbHits());
-        $this->assertEquals([
-            'id' => '190859',
-            'title' => 'American Sniper',
-            'poster' => 'https://image.tmdb.org/t/p/w1280/svPHnYE7N5NAGO49dBmRhq0vDQ3.jpg',
-            'overview' => 'U.S. Navy SEAL Chris Kyle takes his sole mission—protect his comrades—to heart and becomes one of the most lethal snipers in American history. His pinpoint accuracy not only saves countless lives but also makes him a prime...',
-            'release_date' => 1418256000,
-        ], $filteredResults->getHit(1)); // Not getHits(0) because array_filter() does not reorder the indexes after filtering.
-    }
-
-    public function testResultCanBeReturnedAsJson(): void
-    {
-        $json = $this->basicResult->toJSON();
-
-        $this->assertStringContainsString('hits', $json);
-        $this->assertStringContainsString('offset', $json);
-        $this->assertStringContainsString('limit', $json);
-        $this->assertStringContainsString('hitsCount', $json);
-        $this->assertStringContainsString('nbHits', $json);
-        $this->assertStringContainsString('exhaustiveNbHits', $json);
-        $this->assertStringContainsString('processingTimeMs', $json);
-        $this->assertStringContainsString('query', $json);
-        $this->assertStringContainsString('exhaustiveFacetsCount', $json);
-        $this->assertStringContainsString('facetsDistribution', $json);
-    }
-
-    public function testGetRaw(): void
-    {
-        $this->assertEquals($this->basicServerResponse, $this->basicResult->getRaw());
-    }
-
-    public function testTransformHitsMethod(): void
-    {
-        $keepAmericanSniperFunc = function (array $hits) {
-            return array_filter(
-                $hits,
-                function (array $hit) { return 'American Sniper' === $hit['title']; }
-            );
-        };
-
-        $response = $this->basicResult->transformHits($keepAmericanSniperFunc);
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertSame('American Sniper', $response->getHit(1)['title']); // Not getHits(0) because array_filter() does not reorder the indexes after filtering.
-        $this->assertSame(976, $response->getNbHits());
-        $this->assertSame(1, $response->getHitsCount());
-        $this->assertSame(1, $response->count());
-    }
-
-    public function testTransformFacetsDritributionMethod(): void
-    {
-        $facetsToUpperFunc = function (array $facets) {
-            $changeOneFacet = function (array $facet) {
-                $result = [];
-                foreach ($facet as $k => $v) {
-                    $result[strtoupper($k)] = $v;
-                }
-
-                return $result;
-            };
-
-            return array_map($changeOneFacet, $facets);
-        };
-
-        $response = $this->resultWithFacets->transformFacetsDistribution($facetsToUpperFunc);
-
-        $this->assertArrayHasKey('hits', $response->toArray());
-        $this->assertArrayHasKey('facetsDistribution', $response->toArray());
-        $this->assertArrayHasKey('offset', $response->toArray());
-        $this->assertArrayHasKey('limit', $response->toArray());
-        $this->assertArrayHasKey('processingTimeMs', $response->toArray());
-        $this->assertArrayHasKey('query', $response->toArray());
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertNotEquals($response->getRaw()['facetsDistribution'], $response->getFacetsDistribution());
-        $this->assertCount(3, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(0, $response->getFacetsDistribution()['genre']['ROMANCE']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['FANTASY']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['ADVENTURE']);
-    }
-
-    public function testRemoveZeroFacetsMethod(): void
-    {
-        $response = $this->resultWithFacets->removeZeroFacets();
-
-        $this->assertCount(2, $response->getFacetsDistribution()['genre']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['adventure']);
-        $this->assertEquals(1, $response->getFacetsDistribution()['genre']['fantasy']);
-        $this->assertCount(3, $response->getRaw()['facetsDistribution']['genre']);
-        $this->assertEquals($response->getRaw()['hits'], $response->getHits());
-        $this->assertNotEquals($response->getRaw()['facetsDistribution'], $response->getFacetsDistribution());
-    }
-}

+ 0 - 55
vendor/meilisearch/meilisearch-php/tests/Settings/AttributesForFacetingTest.php

@@ -1,55 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class AttributesForFacetingTest extends TestCase
-{
-    public function testGetDefaultAttributesForFaceting(): void
-    {
-        $index = $this->client->createIndex('index');
-
-        $attributes = $index->getAttributesForFaceting();
-
-        $this->assertIsArray($attributes);
-        $this->assertEmpty($attributes);
-    }
-
-    public function testUpdateAttributesForFaceting(): void
-    {
-        $newAttributes = ['title'];
-        $index = $this->client->createIndex('index');
-
-        $promise = $index->updateAttributesForFaceting($newAttributes);
-
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $attributesForFaceting = $index->getAttributesForFaceting();
-
-        $this->assertIsArray($attributesForFaceting);
-        $this->assertEquals($newAttributes, $attributesForFaceting);
-    }
-
-    public function testResetAttributesForFaceting(): void
-    {
-        $index = $this->client->createIndex('index');
-        $newAttributes = ['title'];
-
-        $promise = $index->updateAttributesForFaceting($newAttributes);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $promise = $index->resetAttributesForFaceting();
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $attributesForFaceting = $index->getAttributesForFaceting();
-        $this->assertIsArray($attributesForFaceting);
-        $this->assertEmpty($attributesForFaceting);
-    }
-}

+ 0 - 60
vendor/meilisearch/meilisearch-php/tests/Settings/DisplayedAttributesTest.php

@@ -1,60 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class DisplayedAttributesTest extends TestCase
-{
-    public function testGetDefaultDisplayedAttributes(): void
-    {
-        $indexA = $this->client->createIndex('indexA');
-        $indexB = $this->client->createIndex('indexB', ['primaryKey' => 'objectID']);
-
-        $attributesA = $indexA->getDisplayedAttributes();
-        $attributesB = $indexB->getDisplayedAttributes();
-
-        $this->assertIsArray($attributesA);
-        $this->assertEquals(['*'], $attributesA);
-
-        $this->assertIsArray($attributesB);
-        $this->assertEquals(['*'], $attributesB);
-    }
-
-    public function testUpdateDisplayedAttributes(): void
-    {
-        $newAttributes = ['title'];
-        $index = $this->client->createIndex('index');
-
-        $promise = $index->updateDisplayedAttributes($newAttributes);
-
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $displayedAttributes = $index->getDisplayedAttributes();
-
-        $this->assertIsArray($displayedAttributes);
-        $this->assertEquals($newAttributes, $displayedAttributes);
-    }
-
-    public function testResetDisplayedAttributes(): void
-    {
-        $index = $this->client->createIndex('index');
-        $newAttributes = ['title'];
-
-        $promise = $index->updateDisplayedAttributes($newAttributes);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $promise = $index->resetDisplayedAttributes();
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $displayedAttributes = $index->getDisplayedAttributes();
-        $this->assertIsArray($displayedAttributes);
-        $this->assertEquals(['*'], $displayedAttributes);
-    }
-}

+ 0 - 48
vendor/meilisearch/meilisearch-php/tests/Settings/DistinctAttributeTest.php

@@ -1,48 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class DistinctAttributeTest extends TestCase
-{
-    private $index;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-    }
-
-    public function testGetDefaultDistinctAttribute(): void
-    {
-        $response = $this->index->getDistinctAttribute();
-        $this->assertNull($response);
-    }
-
-    public function testUpdateDistinctAttribute(): void
-    {
-        $distinctAttribute = 'description';
-        $promise = $this->index->updateDistinctAttribute($distinctAttribute);
-
-        $this->assertIsValidPromise($promise);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-
-        $this->assertEquals($distinctAttribute, $this->index->getDistinctAttribute());
-    }
-
-    public function testResetDistinctAttribute(): void
-    {
-        $distinctAttribute = 'description';
-        $promise = $this->index->updateDistinctAttribute($distinctAttribute);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-
-        $promise = $this->index->resetDistinctAttribute();
-
-        $this->assertIsValidPromise($promise);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-        $this->assertNull($this->index->getDistinctAttribute());
-    }
-}

+ 0 - 67
vendor/meilisearch/meilisearch-php/tests/Settings/RankingRulesTest.php

@@ -1,67 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class RankingRulesTest extends TestCase
-{
-    private $index;
-
-    const DEFAULT_RANKING_RULES = [
-        'typo',
-        'words',
-        'proximity',
-        'attribute',
-        'wordsPosition',
-        'exactness',
-    ];
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-    }
-
-    public function testGetDefaultRankingRules(): void
-    {
-        $response = $this->index->getRankingRules();
-
-        $this->assertIsArray($response);
-        $this->assertEquals(self::DEFAULT_RANKING_RULES, $response);
-    }
-
-    public function testUpdateRankingRules(): void
-    {
-        $newRankingRules = [
-            'asc(title)',
-            'typo',
-            'desc(description)',
-        ];
-
-        $promise = $this->index->updateRankingRules($newRankingRules);
-
-        $this->assertIsValidPromise($promise);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-
-        $rankingRules = $this->index->getRankingRules();
-
-        $this->assertIsArray($rankingRules);
-        $this->assertEquals($newRankingRules, $rankingRules);
-    }
-
-    public function testResetRankingRules(): void
-    {
-        $promise = $this->index->resetRankingRules();
-
-        $this->assertIsValidPromise($promise);
-
-        $this->index->waitForPendingUpdate($promise['updateId']);
-        $rankingRules = $this->index->getRankingRules();
-
-        $this->assertIsArray($rankingRules);
-        $this->assertEquals(self::DEFAULT_RANKING_RULES, $rankingRules);
-    }
-}

+ 0 - 57
vendor/meilisearch/meilisearch-php/tests/Settings/SearchableAttributesTest.php

@@ -1,57 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class SearchableAttributesTest extends TestCase
-{
-    public function testGetDefaultSearchableAttributes(): void
-    {
-        $indexA = $this->client->createIndex('indexA');
-        $indexB = $this->client->createIndex('indexB', ['primaryKey' => 'objectID']);
-
-        $searchableAttributesA = $indexA->getSearchableAttributes();
-        $searchableAttributesB = $indexB->getSearchableAttributes();
-
-        $this->assertIsArray($searchableAttributesA);
-        $this->assertEquals(['*'], $searchableAttributesA);
-        $this->assertIsArray($searchableAttributesB);
-        $this->assertEquals(['*'], $searchableAttributesB);
-    }
-
-    public function testUpdateSearchableAttributes(): void
-    {
-        $indexA = $this->client->createIndex('indexA');
-        $searchableAttributes = [
-            'title',
-            'description',
-        ];
-
-        $promise = $indexA->updateSearchableAttributes($searchableAttributes);
-
-        $this->assertIsValidPromise($promise);
-
-        $indexA->waitForPendingUpdate($promise['updateId']);
-        $updatedAttributes = $indexA->getSearchableAttributes();
-
-        $this->assertIsArray($updatedAttributes);
-        $this->assertEquals($searchableAttributes, $updatedAttributes);
-    }
-
-    public function testResetSearchableAttributes(): void
-    {
-        $index = $this->client->createIndex('indexA');
-        $promise = $index->resetSearchableAttributes();
-
-        $this->assertIsValidPromise($promise);
-
-        $index->waitForPendingUpdate($promise['updateId']);
-        $searchableAttributes = $index->getSearchableAttributes();
-
-        $this->assertIsArray($searchableAttributes);
-        $this->assertEquals(['*'], $searchableAttributes);
-    }
-}

+ 0 - 140
vendor/meilisearch/meilisearch-php/tests/Settings/SettingsTest.php

@@ -1,140 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class SettingsTest extends TestCase
-{
-    const DEFAULT_RANKING_RULES = [
-        'typo',
-        'words',
-        'proximity',
-        'attribute',
-        'wordsPosition',
-        'exactness',
-    ];
-
-    const DEFAULT_SEARCHABLE_ATTRIBUTES = ['*'];
-    const DEFAULT_DISPLAYED_ATTRIBUTES = ['*'];
-
-    public function testGetDefaultSettings(): void
-    {
-        $primaryKey = 'ObjectID';
-        $settingA = $this->client
-            ->createIndex('indexA')
-            ->getSettings();
-        $settingB = $this->client
-            ->createIndex(
-                'indexB',
-                ['primaryKey' => $primaryKey]
-            )->getSettings();
-
-        $this->assertEquals(self::DEFAULT_RANKING_RULES, $settingA['rankingRules']);
-        $this->assertNull($settingA['distinctAttribute']);
-        $this->assertIsArray($settingA['searchableAttributes']);
-        $this->assertEquals(self::DEFAULT_SEARCHABLE_ATTRIBUTES, $settingA['searchableAttributes']);
-        $this->assertIsArray($settingA['displayedAttributes']);
-        $this->assertEquals(self::DEFAULT_DISPLAYED_ATTRIBUTES, $settingA['displayedAttributes']);
-        $this->assertIsArray($settingA['stopWords']);
-        $this->assertEmpty($settingA['stopWords']);
-        $this->assertIsArray($settingA['synonyms']);
-        $this->assertEmpty($settingA['synonyms']);
-
-        $this->assertEquals(self::DEFAULT_RANKING_RULES, $settingB['rankingRules']);
-        $this->assertNull($settingB['distinctAttribute']);
-        $this->assertEquals(self::DEFAULT_SEARCHABLE_ATTRIBUTES, $settingB['searchableAttributes']);
-        $this->assertEquals(self::DEFAULT_DISPLAYED_ATTRIBUTES, $settingB['displayedAttributes']);
-        $this->assertIsArray($settingB['stopWords']);
-        $this->assertEmpty($settingB['stopWords']);
-        $this->assertIsArray($settingB['synonyms']);
-        $this->assertEmpty($settingB['synonyms']);
-    }
-
-    public function testUpdateSettings(): void
-    {
-        $index = $this->client->createIndex('index');
-        $promise = $index->updateSettings([
-            'distinctAttribute' => 'title',
-            'rankingRules' => ['asc(title)', 'typo'],
-            'stopWords' => ['the'],
-        ]);
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $settings = $index->getSettings();
-
-        $this->assertEquals(['asc(title)', 'typo'], $settings['rankingRules']);
-        $this->assertEquals('title', $settings['distinctAttribute']);
-        $this->assertIsArray($settings['searchableAttributes']);
-        $this->assertEquals(self::DEFAULT_SEARCHABLE_ATTRIBUTES, $settings['searchableAttributes']);
-        $this->assertIsArray($settings['displayedAttributes']);
-        $this->assertEquals(self::DEFAULT_DISPLAYED_ATTRIBUTES, $settings['displayedAttributes']);
-        $this->assertEquals(['the'], $settings['stopWords']);
-        $this->assertIsArray($settings['synonyms']);
-        $this->assertEmpty($settings['synonyms']);
-    }
-
-    public function testUpdateSettingsWithoutOverwritingThem(): void
-    {
-        $index = $this->client->createIndex('index');
-        $promise = $index->updateSettings([
-            'distinctAttribute' => 'title',
-            'rankingRules' => ['asc(title)', 'typo'],
-            'stopWords' => ['the'],
-        ]);
-
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $promise = $index->updateSettings([
-            'searchableAttributes' => ['title'],
-        ]);
-
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $settings = $index->getSettings();
-
-        $this->assertEquals(['asc(title)', 'typo'], $settings['rankingRules']);
-        $this->assertEquals('title', $settings['distinctAttribute']);
-        $this->assertEquals(['title'], $settings['searchableAttributes']);
-        $this->assertIsArray($settings['displayedAttributes']);
-        $this->assertEquals(self::DEFAULT_SEARCHABLE_ATTRIBUTES, $settings['displayedAttributes']);
-        $this->assertEquals(['the'], $settings['stopWords']);
-        $this->assertIsArray($settings['synonyms']);
-        $this->assertEmpty($settings['synonyms']);
-    }
-
-    public function testResetSettings(): void
-    {
-        $index = $this->client->createIndex('index');
-        $promise = $index->updateSettings([
-            'distinctAttribute' => 'title',
-            'rankingRules' => ['asc(title)', 'typo'],
-            'stopWords' => ['the'],
-        ]);
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $promise = $index->resetSettings();
-
-        $this->assertIsValidPromise($promise);
-        $index->waitForPendingUpdate($promise['updateId']);
-
-        $settings = $index->getSettings();
-
-        $this->assertEquals(self::DEFAULT_RANKING_RULES, $settings['rankingRules']);
-        $this->assertNull($settings['distinctAttribute']);
-        $this->assertIsArray($settings['searchableAttributes']);
-        $this->assertEquals(self::DEFAULT_SEARCHABLE_ATTRIBUTES, $settings['searchableAttributes']);
-        $this->assertIsArray($settings['displayedAttributes']);
-        $this->assertEquals(self::DEFAULT_SEARCHABLE_ATTRIBUTES, $settings['displayedAttributes']);
-        $this->assertIsArray($settings['stopWords']);
-        $this->assertEmpty($settings['stopWords']);
-        $this->assertIsArray($settings['synonyms']);
-        $this->assertEmpty($settings['synonyms']);
-    }
-}

+ 0 - 56
vendor/meilisearch/meilisearch-php/tests/Settings/StopWordsTest.php

@@ -1,56 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class StopWordsTest extends TestCase
-{
-    private $index;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-    }
-
-    public function testGetDefaultStopWords(): void
-    {
-        $response = $this->index->getStopWords();
-
-        $this->assertIsArray($response);
-        $this->assertEmpty($response);
-    }
-
-    public function testUpdateStopWords(): void
-    {
-        $newStopWords = ['the'];
-        $promise = $this->index->updateStopWords($newStopWords);
-
-        $this->assertIsValidPromise($promise);
-
-        $this->index->waitForPendingUpdate($promise['updateId']);
-        $stopWords = $this->index->getStopWords();
-
-        $this->assertIsArray($stopWords);
-        $this->assertEquals($newStopWords, $stopWords);
-    }
-
-    public function testResetStopWords(): void
-    {
-        $promise = $this->index->updateStopWords(['the']);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-
-        $promise = $this->index->resetStopWords();
-
-        $this->assertIsValidPromise($promise);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-
-        $topWords = $this->index->getStopWords();
-
-        $this->assertIsArray($topWords);
-        $this->assertEmpty($topWords);
-    }
-}

+ 0 - 59
vendor/meilisearch/meilisearch-php/tests/Settings/SynonymsTest.php

@@ -1,59 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests\Settings;
-
-use Tests\TestCase;
-
-final class SynonymsTest extends TestCase
-{
-    private $index;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->index = $this->client->createIndex('index');
-    }
-
-    public function testGetDefaultSynonyms(): void
-    {
-        $response = $this->index->getSynonyms();
-
-        $this->assertIsArray($response);
-        $this->assertEmpty($response);
-    }
-
-    public function testUpdateSynonyms(): void
-    {
-        $newSynonyms = [
-            'hp' => ['harry potter'],
-        ];
-        $promise = $this->index->updateSynonyms($newSynonyms);
-
-        $this->assertIsValidPromise($promise);
-
-        $this->index->waitForPendingUpdate($promise['updateId']);
-        $synonyms = $this->index->getSynonyms();
-
-        $this->assertIsArray($synonyms);
-        $this->assertEquals($newSynonyms, $synonyms);
-    }
-
-    public function testResetSynonyms(): void
-    {
-        $promise = $this->index->updateSynonyms([
-            'hp' => ['harry potter'],
-        ]);
-        $this->index->waitForPendingUpdate($promise['updateId']);
-        $promise = $this->index->resetSynonyms();
-
-        $this->assertIsValidPromise($promise);
-
-        $this->index->waitForPendingUpdate($promise['updateId']);
-        $synonyms = $this->index->getSynonyms();
-
-        $this->assertIsArray($synonyms);
-        $this->assertEmpty($synonyms);
-    }
-}

+ 0 - 47
vendor/meilisearch/meilisearch-php/tests/TestCase.php

@@ -1,47 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Tests;
-
-use MeiliSearch\Client;
-use PHPUnit\Framework\TestCase as BaseTestCase;
-
-abstract class TestCase extends BaseTestCase
-{
-    protected const DOCUMENTS = [
-        ['id' => 123, 'title' => 'Pride and Prejudice', 'comment' => 'A great book', 'genre' => 'romance'],
-        ['id' => 456, 'title' => 'Le Petit Prince', 'comment' => 'A french book', 'genre' => 'adventure'],
-        ['id' => 2, 'title' => 'Le Rouge et le Noir', 'comment' => 'Another french book', 'genre' => 'romance'],
-        ['id' => 1, 'title' => 'Alice In Wonderland', 'comment' => 'A weird book', 'genre' => 'fantasy'],
-        ['id' => 1344, 'title' => 'The Hobbit', 'comment' => 'An awesome book', 'genre' => 'romance'],
-        ['id' => 4, 'title' => 'Harry Potter and the Half-Blood Prince', 'comment' => 'The best book', 'genre' => 'fantasy'],
-        ['id' => 42, 'title' => 'The Hitchhiker\'s Guide to the Galaxy'],
-    ];
-
-    protected const HOST = 'http://localhost:7700';
-
-    protected const DEFAULT_KEY = 'masterKey';
-
-    /**
-     * @var Client
-     */
-    protected $client;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->client = new Client(self::HOST, self::DEFAULT_KEY);
-    }
-
-    protected function tearDown(): void
-    {
-        $this->client->deleteAllIndexes();
-    }
-
-    public function assertIsValidPromise(array $promise): void
-    {
-        $this->assertIsArray($promise);
-        $this->assertArrayHasKey('updateId', $promise);
-    }
-}

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2022-03-23 11:01:15
+// This file is automatically generated at:2022-04-09 02:21:29
 declare (strict_types = 1);
 return array (
   0 => 'think\\captcha\\CaptchaService',