feat: analyse import + all tests fixed

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-10-15 16:14:15 +02:00
parent fbe9619224
commit 3170a7c60e
74 changed files with 4318 additions and 183 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Tests\Shared\Adapter;
use App\Domain\Shared\Domain\Contract\EventDispatcherInterface;
class InMemoryEventDispatcher implements EventDispatcherInterface
{
/** @var array<object> */
private array $dispatchedEvents = [];
public function dispatch(object $event): void
{
$this->dispatchedEvents[] = $event;
}
/**
* @return array<object>
*/
public function getDispatchedEvents(): array
{
return $this->dispatchedEvents;
}
public function clear(): void
{
$this->dispatchedEvents = [];
}
/**
* @template T of object
* @param class-string<T> $eventClass
* @return array<T>
*/
public function getDispatchedEventsOfType(string $eventClass): array
{
return array_filter(
$this->dispatchedEvents,
fn(object $event) => $event instanceof $eventClass
);
}
}

Binary file not shown.