for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace EventSauce\EventSourcing;
trait AggregateAlwaysAppliesEvents
{
private int $aggregateRootVersion = 0;
protected function apply(object $event): void
$parts = explode('\\', get_class($event));
$this->{'apply' . end($parts)}($event);
++$this->aggregateRootVersion;
}