packagist meilisearch/meilisearch-php v2.0.0-beta.2
v2.0.0-beta.2 🌱

one day ago

Warning

This is a beta release.

Migration guide

Database stats now return a typed Stats object

$stats = $client->stats();

// Before (v1.x) - accessing stats as array
$databaseSize = $response['databaseSize'];
$usedDatabaseSize = $response['usedDatabaseSize'];
// etc...

// After (v2.x) - use getter methods
$databaseSize = $stats->getDatabaseSize();
$usedDatabaseSize = $stats->getUsedDatabaseSize();

Version is now a typed Version object

$version = $client->version();

// Before (v1.x) - access as array
$commitSha = $version['commitSha'];
$commitDate = $version['commitDate']; // String
$pkgVersion = $version['pkgVersion'];

// After (v2.x) - use getter methods
$commitSha = $version->getCommitSha();
$commitDate = $version->getCommitDate(); // \DateTimeImmutable
$pkgVersion = $version->getPkgVersion();

Removed legacy MeiliSearch namespace

We removed MeiliSearch (capital S) namespace.

// Before (v1.x) - MeiliSearch with capital S
use MeiliSearch\Client;

// After (v2.x) - Meilisearch without capital S
use Meilisearch\Client;

Removed Indexes::parseDate() public method

This only affects you if you were using this utility method directly.

// Before (v1.x) - If you used this method in your code
$dateTime = \Meilisearch\Endpoints\Indexes::parseDate('2021-01-01T01:23:45.123456Z');

// After (v2.x) - Use native PHP instead
$dateTime = new \DateTimeImmutable('2021-01-01T01:23:45.123456Z');

⚠️ Breaking changes

🐛 Bug Fixes

⚙️ Maintenance/misc

Thanks to @Strift, @bpolaszek, @dependabot[bot], @norkunas, @tacman, and @walkwizus! 🎉

See full changelog: v2.0.0-beta.1...v2.0.0-beta.2

Don't miss a new meilisearch-php release

NewReleases is sending notifications on new releases.