Skip to content

Commit 01554e4

Browse files
committed
minor #16709 [Workflow] add back information on accessing the context in guard events (xabbuh)
This PR was merged into the 6.0 branch. Discussion ---------- [Workflow] add back information on accessing the context in guard events This information was present in older versions of the documentation, but got lost when the `versionadded` directive was removed in the `6.0` branch. see symfony/symfony#40742 (comment) Commits ------- 2e5a64d add back information on accessing the context in guard events
2 parents 5d197e7 + 2e5a64d commit 01554e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

workflow.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,14 @@ order:
382382

383383
$workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]);
384384

385-
The context is accessible in all events::
385+
The context is accessible in all events except for the ``workflow.guard`` events::
386386

387-
// $context must be an array
388-
$context = ['context_key' => 'context_value'];
389-
$workflow->apply($subject, $transitionName, $context);
387+
// $context must be an array
388+
$context = ['context_key' => 'context_value'];
389+
$workflow->apply($subject, $transitionName, $context);
390390

391-
// in an event listener (workflow.guard events)
392-
$context = $event->getContext(); // returns ['context']
391+
// in an event listener (workflow.guard events)
392+
$context = $event->getContext(); // returns ['context']
393393

394394
.. note::
395395

0 commit comments

Comments
 (0)