symfony-docs
symfony-docs copied to clipboard
[Workflow] Mark registry as internal and deprecate the service
| Q | A |
|---|---|
| Feature PR | symfony/symfony#46000 |
| PR author(s) | @lyrixx |
| Merged in | 6.2 |
TL;DR:
- The WorkflowRegistry should never be used (we must not document it)
- People have to inject the workflow where they need it. Typing
WorkflowInterfaceworks fine if only one workflow exists. Otherwise use named serviced. Example. This exists for ages and works fine. Otherwise, one can still use the raw service id :workflow.[name]orstate_machine.[name] - If they need all workflows (docs for examples) they can inject all services tagged with
workflow=> all workflow + state_machineworkflow.workflow=> all workflowworkflow.state_machine=> all state_machine
Hi @lyrixx. Can you make the suggested changes in this section https://symfony.com/doc/current/workflow.html#accessing-the-workflow-in-a-class ? I think what is needed is remove the "Alternatively, ..." part and add a quick note about the services providing all workflows/state machines.