prooph/event-store or compatible event-sourced architecture.snapshots, snapshot_metadata) is mandatory.serialize(), but PHP 8’s strict typing may now surface issues with non-serializable properties (e.g., DateTimeImmutable vs. DateTime) more aggressively.new \Prooph\PDO\Snapshot\SnapshotStore($pdo, 'snapshots')).array{} short syntax in closures).axiom/axiom).__set_state() hacks, no deprecated serialize() behavior)?spiral/event-store, axiom/axiom) for long-term maintenance?serialize() limitations in PHP 8?array{} in snapshots)?serialize() failures)?phpunit/phpunit and laravel/framework to PHP 8+ versions.$this->app->bind(\Prooph\Snapshot\SnapshotStoreInterface::class, function ($app) {
return new \Prooph\PDO\Snapshot\SnapshotStore(
pdo: $app['db']->connection('mysql')->getPdo(),
tableName: 'snapshots'
);
});
prooph/event-store v4+ (PHP 8 compatible).phpunit/phpunit to ^9.5 and laravel/framework to ^9.0|^10.0.php artisan vendor:publish --tag=pint and update .php-cs-fixer.dist.php for PHP 8 syntax.enum types that serialize poorly).composer require prooph/event-store:^4.0 prooph/pdo-snapshot-store:^1.6
$snapshot = serialize($aggregate->getSnapshot());
$unserialized = unserialize($snapshot);
assert($unserialized instanceof stdClass); // Or custom DTO
PHPUnit’s expectDeprecation() to catch serialize() warnings.jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.0', '8.1', '8.2']
prooph/event-store:^4.0 (PHP 8 compatible).serialize() may fail on:
use of non-serializable objects.array{} in closures).DB::transaction().Invoice with simple properties).ProductCatalog).axiom/axiom or spiral/event-store in 12–24 months.serialize() behavior changes).Snapshot serialization failed for [aggregate_id]: [error]).serialize() warnings in production.error_reporting(E_ALL);
ini_set('display_errors', '1');
$snapshot = serialize($aggregate->getSnapshot()); // Will throw on failure
php artisan
How can I help you explore Laravel packages today?