Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
402 changes: 0 additions & 402 deletions UPGRADE-2.0.md

This file was deleted.

2 changes: 0 additions & 2 deletions UPGRADE-3.0.md

This file was deleted.

12 changes: 3 additions & 9 deletions baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,9 @@
</InternalMethod>
</file>
<file src="src/Serializer/Normalizer/IdNormalizer.php">
<DeprecatedClass>
<code><![CDATA[ReflectionTypeUtil::classStringInstanceOf(
$reflectionType,
AggregateRootId::class,
)]]></code>
</DeprecatedClass>
<DeprecatedInterface>
<code><![CDATA[IdNormalizer]]></code>
</DeprecatedInterface>
<PropertyTypeCoercion>
<code><![CDATA[$type->getClassName()]]></code>
</PropertyTypeCoercion>
</file>
<file src="src/Serializer/Upcast/Upcast.php">
<MixedAssignment>
Expand Down
12 changes: 6 additions & 6 deletions deptrac-baseline.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
deptrac:
skip_violations:
Patchlevel\EventSourcing\Aggregate\AggregateRootId:
- Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer
Patchlevel\EventSourcing\Aggregate\CustomId:
- Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer
Patchlevel\EventSourcing\Aggregate\Uuid:
- Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer
Patchlevel\EventSourcing\Attribute\Processor:
- Patchlevel\EventSourcing\Subscription\RunMode
Patchlevel\EventSourcing\Attribute\Projector:
Expand All @@ -14,3 +8,9 @@ deptrac:
- Patchlevel\EventSourcing\Aggregate\AggregateRoot
Patchlevel\EventSourcing\Attribute\Subscriber:
- Patchlevel\EventSourcing\Subscription\RunMode
Patchlevel\EventSourcing\Identifier\CustomId:
- Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer
Patchlevel\EventSourcing\Identifier\Identifier:
- Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer
Patchlevel\EventSourcing\Identifier\Uuid:
- Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer
11 changes: 10 additions & 1 deletion deptrac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ deptrac:
collectors:
- type: directory
value: src/EventBus/.*
- name: Identifier
collectors:
- type: directory
value: src/Identifier/.*
- name: Message
collectors:
- type: directory
Expand Down Expand Up @@ -104,12 +108,14 @@ deptrac:
ruleset:
Aggregate:
- Attribute
- Identifier
- MetadataAggregate
Attribute:
Clock:
CommandBus:
- Aggregate
- Attribute
- Identifier
- MetadataAggregate
- Repository
Console:
Expand Down Expand Up @@ -159,6 +165,7 @@ deptrac:
- Aggregate
- Attribute
- Clock
- Identifier
- Message
- MetadataEvent
- MetadataSubscriber
Expand All @@ -170,6 +177,7 @@ deptrac:
Repository:
- Aggregate
- Clock
- Identifier
- Message
- MetadataAggregate
- MetadataEvent
Expand All @@ -178,12 +186,13 @@ deptrac:
- Store
Schema:
Serializer:
- Aggregate
- Cryptography
- Identifier
- MetadataEvent
Snapshot:
- Aggregate
- Cryptography
- Identifier
- MetadataAggregate
Store:
- Aggregate
Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ nav:
- Event Bus: event_bus.md
- Query Bus: query_bus.md
- Advanced:
- Aggregate ID: aggregate_id.md
- Identifier: identifier.md
- Normalizer: normalizer.md
- Snapshots: snapshots.md
- Personal Data: personal_data.md
Expand Down
25 changes: 23 additions & 2 deletions docs/pages/UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,34 @@

## Aggregates

### Aggregate Root

Method `aggregateRootId` return typehint has been changed from `AggregateRootId` to `Identifier`.

### Aggregate Root Id

`AggregateRootId` was renamed to `Identifier` and moved to the `Patchlevel\EventSourcing\Identifier` namespace.

Following classes have been moved to the `Patchlevel\EventSourcing\Identifier` namespace too:

* `CustomId`
* `CustomIdBehaviour`
* `RamseyUuidV7Behaviour`
* `Uuid`

Return typehint of `fromString` method has been changed from `self` to `static`.
All typehints of other classes `AggregateRootId` have been changed to `Identifier`.

### Child Aggregate

We removed our experimental feature of child aggregates.
This was our first attempt to split aggregates into smaller parts,
but we found a better way to do this with the `Micro Aggregate` feature.

## Aggregate Repository

Typehints for the `AggregateRepository` have been changed, from `AggregateRootId` to `Identifier`.

## Subscription

The constructor of the `DefaultSubscriptionEngine` class has been changed.
Expand Down Expand Up @@ -61,7 +83,6 @@ $subscriptionEngine = new DefaultSubscriptionEngine(
RetryStrategyRepository::withDefault($retryStrategy),
);
```

## Store

### DoctrineDbalStore
Expand Down Expand Up @@ -95,4 +116,4 @@ and replaced with the following headers:
### DoctrineSchemaSubscriber

The `Patchlevel\EventSourcing\Schema\DoctrineSchemaSubscriber` has been removed.
use the `Patchlevel\EventSourcing\Schema\DoctrineSchemaListener` instead.
use the `Patchlevel\EventSourcing\Schema\DoctrineSchemaListener` instead.
22 changes: 11 additions & 11 deletions docs/pages/aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ To make it easy to register with a name, we also add the `Aggregate` attribute.

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('profile')]
final class Profile extends BasicAggregateRoot
Expand All @@ -50,7 +50,7 @@ final class Profile extends BasicAggregateRoot

!!! tip

Find out more about aggregate IDs [here](./aggregate_id.md).
Find out more about aggregate IDs [here](./identifier.md).

We use a so-called named constructor here to create an object of the AggregateRoot.
The constructor itself is protected and cannot be called from outside.
Expand Down Expand Up @@ -94,8 +94,8 @@ For our aggregate we create the Event `ProfileRegistered` with an ID and a name.
We also give the event a unique name using the `Event` attribute.

```php
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Event;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Event('profile.registered')]
final class ProfileRegistered
Expand All @@ -115,10 +115,10 @@ After we have defined the event, we have to adapt the profile aggregate:

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Apply;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('profile')]
final class Profile extends BasicAggregateRoot
Expand Down Expand Up @@ -190,10 +190,10 @@ This method then creates the event `NameChanged` and records it:

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Apply;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('profile')]
final class Profile extends BasicAggregateRoot
Expand Down Expand Up @@ -466,10 +466,10 @@ We can now use the value object `Name` in our aggregate:

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Apply;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('profile')]
final class Profile extends BasicAggregateRoot
Expand Down Expand Up @@ -587,9 +587,9 @@ But you can pass this information by yourself.

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('profile')]
final class Profile extends BasicAggregateRoot
Expand All @@ -614,9 +614,9 @@ But if you still want to make sure that the time is "now" and not in the past or

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;
use Psr\Clock\ClockInterface;

#[Aggregate('profile')]
Expand Down Expand Up @@ -663,10 +663,10 @@ The order handle the order itself and the shipping handle the shipping of the or

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Apply;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('order')]
final class Order extends BasicAggregateRoot
Expand Down Expand Up @@ -694,11 +694,11 @@ In this case, the `Shipping` aggregate listens to the `OrderCreated` event to in

```php
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Attribute\Aggregate;
use Patchlevel\EventSourcing\Attribute\Apply;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcing\Attribute\Stream;
use Patchlevel\EventSourcing\Identifier\Uuid;

#[Aggregate('shipping')]
#[Stream(Order::class)]
Expand Down Expand Up @@ -756,7 +756,7 @@ $aggregateRegistry = (new AttributeAggregateRootRegistryFactory())->create([/* p
```
## Learn more

* [How to create own aggregate id](aggregate_id.md)
* [How to create own aggregate id](identifier.md)
* [How to store and load aggregates](repository.md)
* [How to snapshot aggregates](snapshots.md)
* [How to create Projections](subscription.md)
Expand Down
Loading
Loading