Skip to content

Commit 5137370

Browse files
committed
remove dcb
1 parent c143270 commit 5137370

5 files changed

Lines changed: 11 additions & 132 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
22-
"patchlevel/event-sourcing": "dev-DCB as 3.12.0",
22+
"patchlevel/event-sourcing": "^3.12.0",
2323
"symfony/cache": "^6.4.0|^7.0.0",
2424
"symfony/config": "^6.4.0|^7.0.0",
2525
"symfony/console": "^6.4.1|^7.0.1",

composer.lock

Lines changed: 8 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DependencyInjection/Configuration.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
* },
7878
* clock: array{freeze: ?string, service: ?string},
7979
* aggregate_handlers: array{enabled: bool, bus: string|null},
80-
* dcb: array{enabled: bool},
8180
* }
8281
*/
8382
final class Configuration implements ConfigurationInterface
@@ -105,7 +104,7 @@ public function getConfigTreeBuilder(): TreeBuilder
105104
->addDefaultsIfNotSet()
106105
->children()
107106
->enumNode('type')
108-
->values(['dbal_aggregate', 'dbal_stream', 'dbal_taggable', 'in_memory', 'custom'])
107+
->values(['dbal_aggregate', 'dbal_stream', 'in_memory', 'custom'])
109108
->defaultValue('dbal_aggregate')
110109
->end()
111110
->scalarNode('service')->defaultNull()->end()
@@ -117,7 +116,7 @@ public function getConfigTreeBuilder(): TreeBuilder
117116
->addDefaultsIfNotSet()
118117
->children()
119118
->enumNode('type')
120-
->values(['dbal_aggregate', 'dbal_stream', 'dbal_taggable', 'in_memory', 'custom'])
119+
->values(['dbal_aggregate', 'dbal_stream', 'in_memory', 'custom'])
121120
->end()
122121
->scalarNode('service')->defaultNull()->end()
123122
->arrayNode('options')->variablePrototype()->end()->end()
@@ -334,10 +333,6 @@ public function getConfigTreeBuilder(): TreeBuilder
334333
->end()
335334
->end()
336335

337-
->arrayNode('dcb')
338-
->canBeEnabled()
339-
->end()
340-
341336
->arrayNode('aggregate_handlers')
342337
->canBeEnabled()
343338
->addDefaultsIfNotSet()

src/DependencyInjection/PatchlevelEventSourcingExtension.php

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545
use Patchlevel\EventSourcing\Console\Command\WatchCommand;
4646
use Patchlevel\EventSourcing\Console\DoctrineHelper;
4747
use Patchlevel\EventSourcing\Cryptography\DoctrineCipherKeyStore;
48-
use Patchlevel\EventSourcing\DCB\AttributeEventTagExtractor;
49-
use Patchlevel\EventSourcing\DCB\DecisionModelBuilder;
50-
use Patchlevel\EventSourcing\DCB\EventAppender;
51-
use Patchlevel\EventSourcing\DCB\EventTagExtractor;
52-
use Patchlevel\EventSourcing\DCB\StoreDecisionModelBuilder;
53-
use Patchlevel\EventSourcing\DCB\StoreEventAppender;
5448
use Patchlevel\EventSourcing\EventBus\AttributeListenerProvider;
5549
use Patchlevel\EventSourcing\EventBus\Consumer;
5650
use Patchlevel\EventSourcing\EventBus\DefaultConsumer;
@@ -76,7 +70,6 @@
7670
use Patchlevel\EventSourcing\QueryBus\QueryBus;
7771
use Patchlevel\EventSourcing\Repository\DefaultRepositoryManager;
7872
use Patchlevel\EventSourcing\Repository\MessageDecorator\ChainMessageDecorator;
79-
use Patchlevel\EventSourcing\Repository\MessageDecorator\EventTagDecorator;
8073
use Patchlevel\EventSourcing\Repository\MessageDecorator\MessageDecorator;
8174
use Patchlevel\EventSourcing\Repository\MessageDecorator\SplitStreamDecorator;
8275
use Patchlevel\EventSourcing\Repository\RepositoryManager;
@@ -103,7 +96,6 @@
10396
use Patchlevel\EventSourcing\Store\Store;
10497
use Patchlevel\EventSourcing\Store\StreamDoctrineDbalStore;
10598
use Patchlevel\EventSourcing\Store\StreamReadOnlyStore;
106-
use Patchlevel\EventSourcing\Store\TaggableDoctrineDbalStore;
10799
use Patchlevel\EventSourcing\Subscription\Engine\CatchUpSubscriptionEngine;
108100
use Patchlevel\EventSourcing\Subscription\Engine\DefaultSubscriptionEngine;
109101
use Patchlevel\EventSourcing\Subscription\Engine\GapResolverStoreMessageLoader;
@@ -198,7 +190,6 @@ public function load(array $configs, ContainerBuilder $container): void
198190
$this->configureMigration($config, $container);
199191
$this->configureValueResolver($container);
200192
$this->configureStoreMigration($config, $container);
201-
$this->configureDCB($config, $container);
202193
}
203194

204195
/** @param Config $config */
@@ -241,9 +232,6 @@ private function configureSerializer(array $config, ContainerBuilder $container)
241232
]);
242233

243234
$container->setAlias(HeadersSerializer::class, DefaultHeadersSerializer::class);
244-
245-
$container->register(AttributeEventTagExtractor::class);
246-
$container->setAlias(EventTagExtractor::class, AttributeEventTagExtractor::class);
247235
}
248236

249237
/** @param Config $config */
@@ -641,10 +629,6 @@ private function configureMessageDecorator(ContainerBuilder $container): void
641629
->setArguments([new Reference(EventMetadataFactory::class)])
642630
->addTag('event_sourcing.message_decorator');
643631

644-
$container->register(EventTagDecorator::class)
645-
->setArguments([new Reference(EventTagExtractor::class)])
646-
->addTag('event_sourcing.message_decorator');
647-
648632
$container->registerForAutoconfiguration(MessageDecorator::class)
649633
->addTag('event_sourcing.message_decorator');
650634

@@ -772,27 +756,6 @@ private function configureStore(array $config, ContainerBuilder $container): voi
772756
return;
773757
}
774758

775-
if ($config['store']['type'] === 'dbal_taggable') {
776-
$container->register(TaggableDoctrineDbalStore::class)
777-
->setArguments([
778-
new Reference('event_sourcing.dbal_connection'),
779-
new Reference(EventSerializer::class),
780-
new Reference(EventRegistry::class),
781-
new Reference(HeadersSerializer::class),
782-
new Reference('event_sourcing.clock'),
783-
$config['store']['options'],
784-
])
785-
->addTag('event_sourcing.doctrine_schema_configurator');
786-
787-
$container->setAlias(Store::class, TaggableDoctrineDbalStore::class);
788-
789-
if ($config['store']['read_only']) {
790-
throw new InvalidArgumentException('Taggable store does not support read only');
791-
}
792-
793-
return;
794-
}
795-
796759
throw new InvalidArgumentException(sprintf('Unknown store type "%s"', $config['store']['type']));
797760
}
798761

@@ -859,20 +822,6 @@ private function configureStoreMigration(array $config, ContainerBuilder $contai
859822
return;
860823
}
861824

862-
if ($config['store']['migrate_to_new_store']['type'] === 'dbal_taggable') {
863-
$container->register($id, TaggableDoctrineDbalStore::class)
864-
->setArguments([
865-
new Reference('event_sourcing.dbal_connection'),
866-
new Reference(EventSerializer::class),
867-
new Reference(HeadersSerializer::class),
868-
new Reference('event_sourcing.clock'),
869-
$config['store']['migrate_to_new_store']['options'],
870-
])
871-
->addTag('event_sourcing.doctrine_schema_configurator');
872-
873-
return;
874-
}
875-
876825
throw new InvalidArgumentException(sprintf('Unknown store type "%s"', $config['store']['type']));
877826
}
878827

@@ -1224,31 +1173,6 @@ private function configureCryptography(array $config, ContainerBuilder $containe
12241173
$container->setAlias(PayloadCryptographer::class, PersonalDataPayloadCryptographer::class);
12251174
}
12261175

1227-
/** @param Config $config */
1228-
private function configureDCB(array $config, ContainerBuilder $container): void
1229-
{
1230-
if (!$config['dcb']['enabled']) {
1231-
return;
1232-
}
1233-
1234-
if ($config['store']['type'] !== 'dbal_taggable') {
1235-
throw new InvalidArgumentException(
1236-
'DCB requires a taggable store, please use "dbal_taggable" as store type.',
1237-
);
1238-
}
1239-
1240-
$container->register(StoreDecisionModelBuilder::class)
1241-
->setArguments([new Reference(TaggableDoctrineDbalStore::class)]);
1242-
$container->setAlias(DecisionModelBuilder::class, StoreDecisionModelBuilder::class);
1243-
1244-
$container->register(StoreEventAppender::class)
1245-
->setArguments([
1246-
new Reference(TaggableDoctrineDbalStore::class),
1247-
new Reference(EventTagExtractor::class),
1248-
]);
1249-
$container->setAlias(EventAppender::class, StoreEventAppender::class);
1250-
}
1251-
12521176
private function configureValueResolver(ContainerBuilder $container): void
12531177
{
12541178
$container->register(AggregateRootIdValueResolver::class)

tests/Unit/PatchlevelEventSourcingBundleTest.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@
3434
use Patchlevel\EventSourcing\Console\Command\SubscriptionStatusCommand;
3535
use Patchlevel\EventSourcing\Console\Command\SubscriptionTeardownCommand;
3636
use Patchlevel\EventSourcing\Console\Command\WatchCommand;
37-
use Patchlevel\EventSourcing\DCB\AttributeEventTagExtractor;
38-
use Patchlevel\EventSourcing\DCB\DecisionModelBuilder;
39-
use Patchlevel\EventSourcing\DCB\EventAppender;
40-
use Patchlevel\EventSourcing\DCB\EventTagExtractor;
41-
use Patchlevel\EventSourcing\DCB\StoreDecisionModelBuilder;
42-
use Patchlevel\EventSourcing\DCB\StoreEventAppender;
4337
use Patchlevel\EventSourcing\EventBus\DefaultEventBus;
4438
use Patchlevel\EventSourcing\EventBus\EventBus;
4539
use Patchlevel\EventSourcing\EventBus\Psr14EventBus;
@@ -163,7 +157,6 @@ public function testMinimalConfig(): void
163157
self::assertInstanceOf(EventRegistry::class, $container->get(EventRegistry::class));
164158
self::assertInstanceOf(SystemClock::class, $container->get('event_sourcing.clock'));
165159
self::assertInstanceOf(DefaultSubscriptionEngine::class, $container->get(SubscriptionEngine::class));
166-
self::assertInstanceOf(AttributeEventTagExtractor::class, $container->get(EventTagExtractor::class));
167160

168161
self::assertFalse($container->has(EventBus::class));
169162

@@ -676,30 +669,6 @@ public function testQueryBus(): void
676669
self::assertEquals('foo', $handler->{$tag['method']}(new QueryFoo('foo')));
677670
}
678671

679-
680-
public function testDCB(): void
681-
{
682-
$container = new ContainerBuilder();
683-
684-
$this->compileContainer(
685-
$container,
686-
[
687-
'patchlevel_event_sourcing' => [
688-
'connection' => [
689-
'service' => 'doctrine.dbal.eventstore_connection',
690-
],
691-
'store' => [
692-
'type' => 'dbal_taggable',
693-
],
694-
'dcb' => true,
695-
],
696-
]
697-
);
698-
699-
self::assertInstanceOf(StoreEventAppender::class, $container->get(EventAppender::class));
700-
self::assertInstanceOf(StoreDecisionModelBuilder::class, $container->get(DecisionModelBuilder::class));
701-
}
702-
703672
public function testMessageLoader(): void
704673
{
705674
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)