You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P.S: I see you are updating the docs, you might want to remove the deprecated stuff too, please. Thanks very much for this amazing library.
<?php
declare(strict_types=1);
namespace EventSauce\EventSourcing;
use Generator;
/**
* @template AggregateRootIdType of AggregateRootId
+ * This might be the cause of it... not sure why you have it here. IMHO, `AggregateRootId` is just perfect.
*
*
* @see AggregateRootBehaviour
*/
interface AggregateRoot
{
/**
- * @return AggregateRootIdType+ * @return AggregateRootId
*/
public function aggregateRootId(): AggregateRootId;
public function aggregateRootVersion(): int;
/**
* @return object[]
*/
public function releaseEvents(): array;
/**
- * @param AggregateRootIdType $aggregateRootId+ * @param AggregateRootId $aggregateRootId
* @param Generator<int, object, void, int> $events
*/
public static function reconstituteFromEvents(AggregateRootId $aggregateRootId, Generator $events): static;
}
The text was updated successfully, but these errors were encountered:
@Parables this is template, which makes AggregateRoot a generic; implementors of AggregateRoot should fill in the type (which must be of type AggregateRootId), such that:
By doing this, you are telling static analysers (such as PHPStan, Psalm, etc.) that the AggregateRootIdType for your implementation is a MyGreatAggregateRootId (which is a specific implementation of `AggregateRootId).
This type of mismatch is repeated multiple times.
P.S: I see you are updating the docs, you might want to remove the deprecated stuff too, please. Thanks very much for this amazing library.
The text was updated successfully, but these errors were encountered: