You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update upgrade guide and message docs for 4.0 breaking changes
Document the breaking changes from the merged 4.0 PRs that were missing
from the upgrade guide:
- stream refactor (#847): Store\Stream interface replaced by the concrete
Message\Stream class, removed store-specific stream implementations,
Message\Pipe removed in favor of Stream::transform()
- removed deprecated SubscriberHelper and SubscriberUtil (#805)
- removed SubscriberAccessor / RealSubscriberAccessor interfaces and
deprecated accessor methods, removed AggregateIdArgumentResolver (#756)
- ArgumentMetadata now carries a symfony/type-info Type (#814)
Also update the message docs Pipe section to use the new Stream API.
Copy file name to clipboardExpand all lines: docs/UPGRADE-4.0.md
+84Lines changed: 84 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,47 @@ Further changes:
140
140
*`ProcessedResult` now extends `Result`, so the `execute` method always returns a `Result`. The `Boot` and `Run` commands return a `ProcessedResult`.
141
141
* The `DefaultSubscriptionEngine` accepts an optional `EventDispatcherInterface` as last constructor argument to hook into the engine with own listeners.
142
142
143
+
### SubscriberHelper and SubscriberUtil
144
+
145
+
The deprecated `Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberHelper`
146
+
and the `Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil` trait have been removed.
147
+
148
+
If you need the subscriber id, read it from the metadata instead:
149
+
150
+
```php
151
+
use Patchlevel\EventSourcing\Metadata\Subscriber\AttributeSubscriberMetadataFactory;
152
+
153
+
$metadata = (new AttributeSubscriberMetadataFactory())->metadata($subscriber::class);
154
+
$subscriberId = $metadata->id;
155
+
```
156
+
157
+
### SubscriberAccessor and RealSubscriberAccessor
158
+
159
+
The `Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessor` and
160
+
`Patchlevel\EventSourcing\Subscription\Subscriber\RealSubscriberAccessor` interfaces have been removed.
161
+
Use `Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor` directly.
162
+
163
+
Accordingly, `SubscriberAccessorRepository::get()` now returns a `MetadataSubscriberAccessor|null`
164
+
instead of a `SubscriberAccessor|null`.
165
+
166
+
The deprecated methods `id()`, `group()` and `runMode()` on `MetadataSubscriberAccessor` have been removed.
167
+
Use `->metadata()->id`, `->metadata()->group` and `->metadata()->runMode` instead.
168
+
169
+
### AggregateIdArgumentResolver
170
+
171
+
The deprecated `Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\AggregateIdArgumentResolver`
172
+
has been removed. Automatically resolving the aggregate id in a stream store is not possible.
173
+
Add the aggregate id to your events instead.
174
+
175
+
### ArgumentMetadata
176
+
177
+
The subscriber argument resolver now uses `symfony/type-info` to describe argument types.
178
+
179
+
`Patchlevel\EventSourcing\Metadata\Subscriber\ArgumentMetadata` no longer carries a `string $type`
180
+
and a `bool $allowsNull` property. Instead it now has a single `Symfony\Component\TypeInfo\Type $type` property.
181
+
182
+
If you implemented a custom `ArgumentResolver`, adjust it to read the type from the new `Type` object.
183
+
143
184
## Store
144
185
145
186
### StreamStore
@@ -160,6 +201,49 @@ And all the associated classes:
160
201
161
202
`StreamReadOnlyStore` was been merged in `ReadOnlyStore`.
162
203
204
+
## Stream
205
+
206
+
The stream handling has been reworked. Previously the `Stream` was an interface that every store had to
207
+
implement on its own (`ArrayStream`, `StreamDoctrineDbalStoreStream`, `TaggableDoctrineDbalStoreStream`,
208
+
`GeneratorStream`, ...). Now there is a single generic implementation that you can reuse.
209
+
210
+
### Stream interface
211
+
212
+
The `Patchlevel\EventSourcing\Store\Stream` interface has been removed and replaced by the concrete final
213
+
class `Patchlevel\EventSourcing\Message\Stream`.
214
+
215
+
All stores now return a `Patchlevel\EventSourcing\Message\Stream` from their `load()` method.
216
+
The following store specific stream implementations have been removed:
0 commit comments