handlers = $handlers; $this->registry = $registry; } public function getHandler(EntityWorkflow $entityWorkflow, array $options = []): EntityWorkflowHandlerInterface { foreach ($this->handlers as $handler) { if ($handler->supports($entityWorkflow, $options)) { return $handler; } } throw new HandlerNotFoundException(); } public function getSupportedWorkflows(EntityWorkflow $entityWorkflow): array { return $this->registry->all($entityWorkflow); } }