for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EventSauce\EventSourcing;
use Generator;
class ReconstitutableAggregateRootFactory implements AggregateRootFactory
{
/**
* @var string
*/
private $className;
public function __construct(string $className)
$this->className = $className;
}
public function reconstituteFromEvents(AggregateRootId $aggregateRootId, Generator $events): AggregateRoot
/** @var ReconstitutableAggregateRoot $className */
$className = $this->className;
return $className::reconstituteFromEvents($aggregateRootId, $events);