Skip to content

[Workflow] Injecting a specific state-machine workflow doesn't work as documented #14637

Closed
@spackmat

Description

@spackmat

Hi,

at the moment, in https://symfony.com/doc/current/workflow.html#accessing-the-workflow-in-a-class injecting a specific workflow of type state_machine is not documented correctly:

You can use the workflow inside a class by using service autowiring and using camelCased workflow name + Workflow as parameter name:

For workflows of type state_machine, the correct parameter name must be "camelCased workflow name + StateMachine". At least in the current Symfony 5.2.0. Calling php bin/console debug:autowiring workflow lists the correct names to be used as documented a few lines later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions