public function __construct( private readonly BusinessEventRegistry
$registry,
private readonly EventDispatcherInterface
$eventDispatcher,
private readonly Connection
$connection ) { } public function collect(Context
$context): BusinessEventCollectorResponse
{ $events =
$this->registry->
getClasses();
$result =
new BusinessEventCollectorResponse();
$result =
$this->
fetchAppEvents($result);
foreach ($events as $class) { $definition =
$this->
define($class);
if (!
$definition) { continue;
} $result->
set($definition->
getName(),
$definition);
}