Skip to content
Open
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
242 changes: 126 additions & 116 deletions composer.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/AggregateRootExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Patchlevel\EventSourcingPHPStanExtension;

use Patchlevel\EventSourcing\Aggregate\AggregateRoot;
use Patchlevel\EventSourcing\Aggregate\ChildAggregate;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Rules\Properties\ReadWritePropertiesExtension;

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

foreach ($interfaces as $interface) {
if ($interface->getName() === AggregateRoot::class || $interface->getName() === ChildAggregate::class) {
if ($interface->getName() === AggregateRoot::class) {
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/DecisionModelBuilderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Patchlevel\EventSourcingPHPStanExtension;

use Patchlevel\EventSourcing\DCB\DecisionModel;
use Patchlevel\EventSourcing\DCB\DecisionModelBuilder;
use Patchlevel\EventSourcing\DecisionModel\DecisionModel;
use Patchlevel\EventSourcing\DecisionModel\DecisionModelBuilder;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\MethodReflection;
Expand Down
2 changes: 1 addition & 1 deletion src/ProjectionBuilderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Patchlevel\EventSourcingPHPStanExtension;

use Patchlevel\EventSourcing\DCB\ProjectionBuilder;
use Patchlevel\EventSourcing\Projection\ProjectionBuilder;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\MethodReflection;
Expand Down
2 changes: 1 addition & 1 deletion tests/Invalid/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Invalid;

use Patchlevel\EventSourcing\Aggregate\BasicAggregateRoot;
use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Identifier\Uuid;
use Patchlevel\EventSourcing\Attribute\Apply;
use Patchlevel\EventSourcing\Attribute\Id;
use Patchlevel\EventSourcingPHPStanExtension\Tests\Valid\ProfileCreated;
Expand Down
4 changes: 2 additions & 2 deletions tests/Valid/CreateInvoiceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;

use Patchlevel\EventSourcing\Attribute\Handle;
use Patchlevel\EventSourcing\DCB\DecisionModelBuilder;
use Patchlevel\EventSourcing\DCB\EventAppender;
use Patchlevel\EventSourcing\DecisionModel\DecisionModelBuilder;
use Patchlevel\EventSourcing\DecisionModel\EventAppender;

final class CreateInvoiceHandler
{
Expand Down
11 changes: 3 additions & 8 deletions tests/Valid/NextInvoiceNumberProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@

namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;

use Patchlevel\EventSourcing\DCB\EventRouter;
use Patchlevel\EventSourcing\DCB\Projection;
use Patchlevel\EventSourcing\Projection\BasicProjection;

/**
* @implements Projection<int>
*/
final class NextInvoiceNumberProjection implements Projection
/** @extends BasicProjection<int> */
final class NextInvoiceNumberProjection extends BasicProjection
{
use EventRouter;

/** @return list<string> */
public function tagFilter(): array
{
Expand Down
37 changes: 0 additions & 37 deletions tests/Valid/PersonalInformation.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Valid/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;

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

Expand Down
4 changes: 1 addition & 3 deletions tests/Valid/ProfileCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;

use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Serializer\Normalizer\IdNormalizer;
use Patchlevel\EventSourcing\Identifier\Uuid;

class ProfileCreated
{
public function __construct(
#[IdNormalizer(Uuid::class)]
public readonly Uuid $id,
public readonly string $name
) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Valid/Usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Patchlevel\EventSourcingPHPStanExtension\Tests\Valid;

use Patchlevel\EventSourcing\Aggregate\Uuid;
use Patchlevel\EventSourcing\Identifier\Uuid;

final class Usage
{
Expand Down