Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/EventDrivenCommandGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@

final class EventDrivenCommandGenerator extends CommandGenerator
{
private EventDispatcherInterface $eventDispatcher;
private \DateTimeImmutable $timestamp;

public function __construct(SchemaInterface $schema, ContainerInterface $container)
{
$listenerProvider = new ListenerProvider($schema, $container);

$this->eventDispatcher = new Dispatcher($listenerProvider);
public function __construct(
SchemaInterface $schema,
ContainerInterface $container,
private ?EventDispatcherInterface $eventDispatcher = null
) {
if ($eventDispatcher === null) {
$listenerProvider = new ListenerProvider($schema, $container);
$this->eventDispatcher = new Dispatcher($listenerProvider);
}
}

protected function storeEntity(ORMInterface $orm, Tuple $tuple, bool $isNew): ?CommandInterface
Expand Down