Skip to content

Support for multiple transitions with the same name #9

@kgilden

Description

@kgilden

Currently all transitions must be uniquely named. There's support to allow a transition to go from multiple states to a single end state, i.e.:

$config = ['transitions' => [
    'foo' => [
        'from' => ['a', 'b', 'c'],
        'to' => 'd',
    ],
]];

I propose adding support to have transitions going to different states, but having a same name, i.e.:

$config = ['transitions' => [
    'foo' => [
        [
            'from' => ['a', 'b', 'c'],
            'to' => 'd',
        ],
        [
            'from' => ['e', 'f'],
            'to' => 'g'
        ]
    ],
]];

This might not seem benefitial at first, but would be a huge help, when using the event dispatcher. It would enable having nifty listeners such as listening to confirm transitions and sending e-mails regarding the state change. No explicit listing of transitions would be necessary.

BC can also be kept by simply keeping support for the old structure.

Would you be interested in having this merged, should I implement it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions