From 7929a3842b3e6af3207b1b54adbc0708996f7459 Mon Sep 17 00:00:00 2001 From: David Badura Date: Sat, 20 Apr 2024 09:27:51 +0200 Subject: [PATCH] add store options --- composer.json | 2 +- composer.lock | 14 +++++++------- src/DependencyInjection/Configuration.php | 1 + .../PatchlevelEventSourcingExtension.php | 2 +- tests/Unit/PatchlevelEventSourcingBundleTest.php | 3 +++ 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 6850ee53..573fb681 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ ], "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "patchlevel/event-sourcing": "3.0.0-rc13", + "patchlevel/event-sourcing": "3.0.0-rc14", "symfony/cache": "^6.4.0|^7.0.0", "symfony/config": "^6.4.0|^7.0.0", "symfony/console": "^6.4.1|^7.0.1", diff --git a/composer.lock b/composer.lock index 520c7ce2..06f8734f 100644 --- a/composer.lock +++ b/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": "65cf22edbf4cda05539a3fe13abf9f61", + "content-hash": "40bf38eeecb204139b8bc8e7fcf8dc50", "packages": [ { "name": "brick/math", @@ -411,16 +411,16 @@ }, { "name": "patchlevel/event-sourcing", - "version": "3.0.0-rc13", + "version": "3.0.0-rc14", "source": { "type": "git", "url": "https://github.com/patchlevel/event-sourcing.git", - "reference": "f26e664d22e2c69436858c527708d0229014e0fb" + "reference": "d27f8bc0e216779508ef2fc6dbeb8ff9f3f593b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/patchlevel/event-sourcing/zipball/f26e664d22e2c69436858c527708d0229014e0fb", - "reference": "f26e664d22e2c69436858c527708d0229014e0fb", + "url": "https://api.github.com/repos/patchlevel/event-sourcing/zipball/d27f8bc0e216779508ef2fc6dbeb8ff9f3f593b9", + "reference": "d27f8bc0e216779508ef2fc6dbeb8ff9f3f593b9", "shasum": "" }, "require": { @@ -488,9 +488,9 @@ ], "support": { "issues": "https://github.com/patchlevel/event-sourcing/issues", - "source": "https://github.com/patchlevel/event-sourcing/tree/3.0.0-rc13" + "source": "https://github.com/patchlevel/event-sourcing/tree/3.0.0-rc14" }, - "time": "2024-04-18T08:11:41+00:00" + "time": "2024-04-18T19:13:04+00:00" }, { "name": "patchlevel/hydrator", diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 5a85fe83..eaa4d18a 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -57,6 +57,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->addDefaultsIfNotSet() ->children() ->booleanNode('merge_orm_schema')->defaultFalse()->end() + ->arrayNode('options')->variablePrototype()->end()->end() ->end() ->end() diff --git a/src/DependencyInjection/PatchlevelEventSourcingExtension.php b/src/DependencyInjection/PatchlevelEventSourcingExtension.php index f2d9b212..d00554e1 100644 --- a/src/DependencyInjection/PatchlevelEventSourcingExtension.php +++ b/src/DependencyInjection/PatchlevelEventSourcingExtension.php @@ -471,7 +471,7 @@ private function configureStore(array $config, ContainerBuilder $container): voi new Reference('event_sourcing.dbal_connection'), new Reference(EventSerializer::class), new Reference(HeadersSerializer::class), - $config['store']['options']['table_name'] ?? 'eventstore', + $config['store']['options'], ]) ->addTag('event_sourcing.doctrine_schema_configurator'); diff --git a/tests/Unit/PatchlevelEventSourcingBundleTest.php b/tests/Unit/PatchlevelEventSourcingBundleTest.php index 1871ed90..c5cafa0b 100644 --- a/tests/Unit/PatchlevelEventSourcingBundleTest.php +++ b/tests/Unit/PatchlevelEventSourcingBundleTest.php @@ -813,6 +813,9 @@ public function testFullBuild(): void 'service' => 'doctrine.dbal.eventstore_connection', ], 'store' => [ + 'options' => [ + 'table_name' => 'event_store', + ], ], 'clock' => [ 'service' => 'clock',