Skip to content

Commit

Permalink
Add property types
Browse files Browse the repository at this point in the history
  • Loading branch information
benr77 committed Dec 14, 2024
1 parent acfc226 commit b293c68
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 69 deletions.
5 changes: 1 addition & 4 deletions src/Doctrine/Event/PreAppendEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
*/
class PreAppendEvent extends Event
{
/**
* @var DomainEvent
*/
protected $domainEvent;
protected DomainEvent $domainEvent;

public function __construct(DomainEvent $domainEvent)
{
Expand Down
5 changes: 1 addition & 4 deletions src/Domain/Model/EventId.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

final class EventId
{
/**
* @var UuidInterface
*/
private $id;
private UuidInterface $id;

private function __construct(UuidInterface $id)
{
Expand Down
40 changes: 11 additions & 29 deletions src/Domain/Model/StoredEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,17 @@

class StoredEvent
{
/**
* @var string
*/
private $eventId;

/**
* @var \DateTimeImmutable
*/
private $occurredOn;

/**
* @var \DateTimeImmutable|null
*/
private $publishedOn;

/**
* @var string
*/
private $aggregateRoot;

/**
* @var string
*/
private $typeName;

/**
* @var string
*/
private $eventBody;
private string $eventId;

private \DateTimeImmutable $occurredOn;

private \DateTimeImmutable|null $publishedOn;

private string $aggregateRoot;

private string $typeName;

private string $eventBody;

public function __construct(
EventId $eventId,
Expand Down
14 changes: 3 additions & 11 deletions src/Domain/Model/Traits/DomainEventTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,14 @@

trait DomainEventTrait
{
/**
* @var string
*/
private $aggregateRootId;
private string $aggregateRootId;

/**
* The datetime the event occurred. Please use DomainEvent::MICROSECOND_DATE_FORMAT format.
*
* @var string
*/
private $occurredOn;
private string $occurredOn;

/**
* @var string|null
*/
private $actorId;
private string|null $actorId;

public function setActorId(?string $actorId): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Model/Traits/EventRecorderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait EventRecorderTrait
/**
* @var DomainEvent[]
*/
private $messages = [];
private array $messages = [];

/**
* @return DomainEvent[]
Expand Down
5 changes: 1 addition & 4 deletions src/EventSubscriber/NoEnvelopeDomainEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

class NoEnvelopeDomainEventDispatcher implements DomainEventDispatcher
{
/**
* @var MessageBusInterface
*/
private $eventBus;
private MessageBusInterface $eventBus;

public function __construct(MessageBusInterface $eventBus)
{
Expand Down
20 changes: 4 additions & 16 deletions src/EventSubscriber/PublishDomainEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,13 @@

final class PublishDomainEventSubscriber implements EventSubscriberInterface
{
/**
* @var DomainEventDispatcher
*/
private $domainEventDispatcher;
private DomainEventDispatcher $domainEventDispatcher;

/**
* @var EventStore
*/
private $eventStore;
private EventStore $eventStore;

/**
* @var SerializerInterface
*/
private $serializer;
private SerializerInterface $serializer;

/**
* @var LockFactory
*/
private $lockFactory;
private LockFactory $lockFactory;

public function __construct(
DomainEventDispatcher $domainEventDispatcher,
Expand Down

0 comments on commit b293c68

Please sign in to comment.