Skip to content

Commit b9b10c9

Browse files
committed
upgrade to event sourcing 4.0
1 parent 224f2e1 commit b9b10c9

File tree

10 files changed

+138
-173
lines changed

10 files changed

+138
-173
lines changed

composer.lock

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

src/AggregateRootExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Patchlevel\EventSourcingPHPStanExtension;
66

77
use Patchlevel\EventSourcing\Aggregate\AggregateRoot;
8-
use Patchlevel\EventSourcing\Aggregate\ChildAggregate;
98
use PHPStan\Reflection\PropertyReflection;
109
use PHPStan\Rules\Properties\ReadWritePropertiesExtension;
1110

@@ -26,7 +25,7 @@ public function isInitialized(PropertyReflection $property, string $propertyName
2625
$interfaces = $property->getDeclaringClass()->getInterfaces();
2726

2827
foreach ($interfaces as $interface) {
29-
if ($interface->getName() === AggregateRoot::class || $interface->getName() === ChildAggregate::class) {
28+
if ($interface->getName() === AggregateRoot::class) {
3029
return true;
3130
}
3231
}

src/DecisionModelBuilderExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Patchlevel\EventSourcingPHPStanExtension;
66

7-
use Patchlevel\EventSourcing\DCB\DecisionModel;
8-
use Patchlevel\EventSourcing\DCB\DecisionModelBuilder;
7+
use Patchlevel\EventSourcing\DecisionModel\DecisionModel;
8+
use Patchlevel\EventSourcing\DecisionModel\DecisionModelBuilder;
99
use PhpParser\Node\Expr\MethodCall;
1010
use PHPStan\Analyser\Scope;
1111
use PHPStan\Reflection\MethodReflection;

tests/Invalid/Profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Invalid;
44

55
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
6-
use Patchlevel\EventSourcing\Aggregate\Uuid;
6+
use Patchlevel\EventSourcing\Identifier\Uuid;
77
use Patchlevel\EventSourcing\Attribute\Apply;
88
use Patchlevel\EventSourcing\Attribute\Id;
99
use Patchlevel\EventSourcingPHPStanExtension\Tests\Valid\ProfileCreated;

tests/Valid/CreateInvoiceHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;
66

77
use Patchlevel\EventSourcing\Attribute\Handle;
8-
use Patchlevel\EventSourcing\DCB\DecisionModelBuilder;
9-
use Patchlevel\EventSourcing\DCB\EventAppender;
8+
use Patchlevel\EventSourcing\DecisionModel\DecisionModelBuilder;
9+
use Patchlevel\EventSourcing\DecisionModel\EventAppender;
1010

1111
final class CreateInvoiceHandler
1212
{

tests/Valid/NextInvoiceNumberProjection.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44

55
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;
66

7-
use Patchlevel\EventSourcing\DCB\EventRouter;
8-
use Patchlevel\EventSourcing\DCB\Projection;
7+
use Patchlevel\EventSourcing\Projection\BasicProjection;
98

10-
/**
11-
* @implements Projection<int>
12-
*/
13-
final class NextInvoiceNumberProjection implements Projection
9+
/** @extends BasicProjection<int> */
10+
final class NextInvoiceNumberProjection extends BasicProjection
1411
{
15-
use EventRouter;
16-
1712
/** @return list<string> */
1813
public function tagFilter(): array
1914
{

tests/Valid/PersonalInformation.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/Valid/Profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;
44

55
use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
6-
use Patchlevel\EventSourcing\Aggregate\Uuid;
6+
use Patchlevel\EventSourcing\Identifier\Uuid;
77
use Patchlevel\EventSourcing\Attribute\Apply;
88
use Patchlevel\EventSourcing\Attribute\Id;
99

tests/Valid/ProfileCreated.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;
44

5-
use Patchlevel\EventSourcing\Aggregate\Uuid;
6-
use Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer;
5+
use Patchlevel\EventSourcing\Identifier\Uuid;
76

87
class ProfileCreated
98
{
109
public function __construct(
11-
#[IdNormalizer(Uuid::class)]
1210
public readonly Uuid $id,
1311
public readonly string $name
1412
) {

tests/Valid/Usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;
66

7-
use Patchlevel\EventSourcing\Aggregate\Uuid;
7+
use Patchlevel\EventSourcing\Identifier\Uuid;
88

99
final class Usage
1010
{

0 commit comments

Comments
 (0)