Skip to content

Commit 9ff06ef

Browse files
authored
Merge pull request #287 from patchlevel/3.14.x-merge-up-into-4.0.x_SqVt4Z5I
Merge release 3.14.0 into 4.0.x
2 parents 35bc78e + cfea5f7 commit 9ff06ef

15 files changed

Lines changed: 237 additions & 122 deletions

composer.lock

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

docs/configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ patchlevel_event_sourcing:
343343
store:
344344
type: 'custom' # default is 'dbal'
345345
service: 'my_subscription_store'
346+
options:
347+
table_name: 'my_subscription_store'
346348
```
347349
:::tip
348350
If you are using the [doctrine-test-bundle](https://github.com/dmaicher/doctrine-test-bundle),
@@ -672,7 +674,7 @@ For this you need to enable the crypto shredding.
672674
```yaml
673675
patchlevel_event_sourcing:
674676
cryptography:
675-
use_encrypted_field_name: true,
677+
use_encrypted_field_name: true
676678
```
677679
:::tip
678680
You should activate `use_encrypted_field_name` to mark the fields that are encrypted.

docs/installation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ patchlevel_event_sourcing:
3737
connection:
3838
url: '%env(EVENTSTORE_URL)%'
3939
provide_dedicated_connection: true
40+
store:
41+
type: dbal_stream
42+
# if you are using doctrine bundle you should enable this
43+
#merge_orm_schema: true
44+
command_bus:
45+
service: messenger.default_bus
46+
query_bus:
47+
service: messenger.default_bus
48+
subscription:
49+
gap_detection: ~
50+
51+
# enable this if you want to use sensitive data encryption
52+
#cryptography: ~
53+
# use_encrypted_field_name: true
4054

4155
when@dev:
4256
patchlevel_event_sourcing:
@@ -50,6 +64,8 @@ when@dev:
5064
when@test:
5165
patchlevel_event_sourcing:
5266
subscription:
67+
store:
68+
type: 'static_in_memory'
5369
catch_up: true
5470
throw_on_error: true
5571
run_after_aggregate_save: true

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Usage
22

33
Here you will find some examples of how to use the bundle.
4-
But we provide only examples for specific symfo
4+
But we provide only examples for specific symfony features.
55

66
:::info
77
You can find out more about event sourcing in the library

phpstan-baseline.neon

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,67 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: '#^Parameter \#2 \$id of static method Patchlevel\\EventSourcingBundle\\DependencyInjection\\ServiceAliasResolver\:\:resolve\(\) expects string, array\|bool\|float\|int\|string\|null given\.$#'
5+
identifier: argument.type
6+
count: 1
7+
path: src/DependencyInjection/CommandHandlerCompilerPass.php
8+
39
-
410
message: '#^Parameter \#1 \$classString of static method Patchlevel\\EventSourcing\\QueryBus\\HandlerFinder\:\:findInClass\(\) expects class\-string, string given\.$#'
511
identifier: argument.type
612
count: 1
713
path: src/DependencyInjection/QueryHandlerCompilerPass.php
14+
15+
-
16+
message: '#^Parameter \#2 \$id of static method Patchlevel\\EventSourcingBundle\\DependencyInjection\\ServiceAliasResolver\:\:resolve\(\) expects string, array\|bool\|float\|int\|string\|null given\.$#'
17+
identifier: argument.type
18+
count: 1
19+
path: src/DependencyInjection/QueryHandlerCompilerPass.php
20+
21+
-
22+
message: '#^Property Patchlevel\\EventSourcingBundle\\Tests\\Fixtures\\Profile\:\:\$id is never read, only written\.$#'
23+
identifier: property.onlyWritten
24+
count: 1
25+
path: tests/Fixtures/Profile.php
26+
27+
-
28+
message: '#^Property Patchlevel\\EventSourcingBundle\\Tests\\Fixtures\\SnapshotableProfile\:\:\$id is unused\.$#'
29+
identifier: property.unused
30+
count: 1
31+
path: tests/Fixtures/SnapshotableProfile.php
32+
33+
-
34+
message: '#^Call to an undefined method Symfony\\Component\\DependencyInjection\\ContainerBuilder\:\:getAutoconfiguredAttributes\(\)\.$#'
35+
identifier: method.notFound
36+
count: 1
37+
path: tests/Unit/PatchlevelEventSourcingBundleTest.php
38+
39+
-
40+
message: '#^Cannot access offset ''Patchlevel\\\\EventSourcing\\\\Attribute\\\\Aggregate''\|''Patchlevel\\\\EventSourcing\\\\Attribute\\\\Event'' on mixed\.$#'
41+
identifier: offsetAccess.nonOffsetAccessible
42+
count: 1
43+
path: tests/Unit/PatchlevelEventSourcingBundleTest.php
44+
45+
-
46+
message: '#^Cannot access offset ''bus'' on mixed\.$#'
47+
identifier: offsetAccess.nonOffsetAccessible
48+
count: 3
49+
path: tests/Unit/PatchlevelEventSourcingBundleTest.php
50+
51+
-
52+
message: '#^Cannot access offset ''handles'' on mixed\.$#'
53+
identifier: offsetAccess.nonOffsetAccessible
54+
count: 3
55+
path: tests/Unit/PatchlevelEventSourcingBundleTest.php
56+
57+
-
58+
message: '#^Cannot access offset ''method'' on mixed\.$#'
59+
identifier: offsetAccess.nonOffsetAccessible
60+
count: 2
61+
path: tests/Unit/PatchlevelEventSourcingBundleTest.php
62+
63+
-
64+
message: '#^Trying to invoke mixed but it''s not a callable\.$#'
65+
identifier: callable.nonCallable
66+
count: 1
67+
path: tests/Unit/PatchlevelEventSourcingBundleTest.php

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ parameters:
66
level: max
77
paths:
88
- src
9+
- tests

src/DependencyInjection/CommandHandlerCompilerPass.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ public function process(ContainerBuilder $container): void
2525
return;
2626
}
2727

28-
$bus = $container->getParameter('patchlevel_event_sourcing.aggregate_handlers.bus');
28+
$bus = ServiceAliasResolver::resolve(
29+
$container,
30+
$container->getParameter('patchlevel_event_sourcing.aggregate_handlers.bus'),
31+
);
2932

3033
/** @var AggregateRootRegistry $aggregateRootRegistry */
3134
$aggregateRootRegistry = $container->get(AggregateRootRegistry::class);

src/DependencyInjection/Configuration.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
* },
2323
* query_bus: array{enabled: bool, service: string},
2424
* subscription: array{
25-
* store: array{type: string, service: string|null},
25+
* store: array{
26+
* type: string,
27+
* service: string|null,
28+
* options: array{table_name: string}
29+
* },
2630
* retry_strategy?: array{base_delay: int, delay_factor: int, max_attempts: int},
2731
* retry_strategies: array<string, array{type: string, service: string, options: array<string, mixed>}>,
2832
* default_retry_strategy: string,
@@ -198,6 +202,12 @@ public function getConfigTreeBuilder(): TreeBuilder
198202
->defaultValue('dbal')
199203
->end()
200204
->scalarNode('service')->defaultNull()->end()
205+
->arrayNode('options')
206+
->addDefaultsIfNotSet()
207+
->children()
208+
->scalarNode('table_name')->defaultValue('subscriptions')->end()
209+
->end()
210+
->end()
201211
->end()
202212
->end()
203213

src/DependencyInjection/PatchlevelEventSourcingExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ static function (ChildDefinition $definition): void {
498498
$container->register(DoctrineSubscriptionStore::class)
499499
->setArguments([
500500
new Reference('event_sourcing.dbal_connection'),
501+
new Reference('event_sourcing.clock'),
502+
$config['subscription']['store']['options']['table_name'],
501503
])
502504
->addTag('event_sourcing.doctrine_schema_configurator');
503505

src/DependencyInjection/QueryHandlerCompilerPass.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ public function process(ContainerBuilder $container): void
1919
return;
2020
}
2121

22-
$bus = $container->getParameter('patchlevel_event_sourcing.query_handlers.bus');
22+
$bus = ServiceAliasResolver::resolve(
23+
$container,
24+
$container->getParameter('patchlevel_event_sourcing.query_handlers.bus'),
25+
);
2326
$subscribers = $container->findTaggedServiceIds('event_sourcing.subscriber');
2427

2528
foreach (array_keys($subscribers) as $subscriberServiceName) {

0 commit comments

Comments
 (0)