diff --git a/Classes/AbstractEventSourcedAggregateRoot.php b/Classes/AbstractEventSourcedAggregateRoot.php index 1e7d00d..d3d1b5b 100644 --- a/Classes/AbstractEventSourcedAggregateRoot.php +++ b/Classes/AbstractEventSourcedAggregateRoot.php @@ -49,7 +49,7 @@ final public function getReconstitutionVersion(): int return $this->reconstitutionVersion; } - final public static function reconstituteFromEventStream(EventStream $stream): self + final public static function reconstituteFromEventStream(EventStream $stream): static { $instance = new static(); $lastAppliedEventVersion = -1; diff --git a/Classes/Event/EventTypeResolver.php b/Classes/Event/EventTypeResolver.php index bf5ad24..8ef038d 100644 --- a/Classes/Event/EventTypeResolver.php +++ b/Classes/Event/EventTypeResolver.php @@ -56,7 +56,7 @@ public function injectObjectManager(ObjectManagerInterface $objectManager): void */ public function initializeObject(): void { - $this->mapping = static::eventTypeMapping($this->objectManager); + $this->mapping = self::eventTypeMapping($this->objectManager); $this->reversedMapping = array_flip($this->mapping); } diff --git a/Classes/EventListener/AppliedEventsStorage/DefaultAppliedEventsStorage.php b/Classes/EventListener/AppliedEventsStorage/DefaultAppliedEventsStorage.php index cd301e3..cbf3772 100644 --- a/Classes/EventListener/AppliedEventsStorage/DefaultAppliedEventsStorage.php +++ b/Classes/EventListener/AppliedEventsStorage/DefaultAppliedEventsStorage.php @@ -55,7 +55,7 @@ protected function __construct(string $eventListenerIdentifier) */ public static function forEventListener(EventListenerInterface $listener): self { - return new static(\get_class($listener)); + return new DefaultAppliedEventsStorage(\get_class($listener)); } /** diff --git a/Classes/EventListener/Mapping/EventToListenerMapping.php b/Classes/EventListener/Mapping/EventToListenerMapping.php index 305082e..1ddc4d9 100644 --- a/Classes/EventListener/Mapping/EventToListenerMapping.php +++ b/Classes/EventListener/Mapping/EventToListenerMapping.php @@ -45,7 +45,7 @@ private function __construct(string $eventClassName, string $listenerClassName, public static function create(string $eventClassName, string $listenerClassName, array $options): self { - return new static($eventClassName, $listenerClassName, $options); + return new self($eventClassName, $listenerClassName, $options); } public function getEventClassName(): string diff --git a/Classes/EventPublisher/DeferEventPublisher.php b/Classes/EventPublisher/DeferEventPublisher.php index c0e2526..a6851b0 100644 --- a/Classes/EventPublisher/DeferEventPublisher.php +++ b/Classes/EventPublisher/DeferEventPublisher.php @@ -39,7 +39,7 @@ protected function __construct(EventPublisherInterface $wrappedEventPublisher) public static function forPublisher(EventPublisherInterface $eventPublisher): self { - return new static($eventPublisher); + return new DeferEventPublisher($eventPublisher); } /** diff --git a/Classes/EventStore/WritableEvents.php b/Classes/EventStore/WritableEvents.php index 9c6c462..2f61d14 100644 --- a/Classes/EventStore/WritableEvents.php +++ b/Classes/EventStore/WritableEvents.php @@ -37,14 +37,14 @@ public static function fromArray(array $events): self throw new \InvalidArgumentException(sprintf('Only instances of WritableEvent are allowed, given: %s', \is_object($event) ? \get_class($event) : \gettype($event)), 1540316594); } } - return new static(array_values($events)); + return new self(array_values($events)); } public function append(WritableEvent $event): self { $events = $this->events; $events[] = $event; - return new static($events); + return new self($events); } /**