Skip to content

added Workflow event methods documentation #7774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions workflow/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,30 @@ could easily enable logging::
$subscriber = new AuditTrailListener($logger);
$dispatcher->addSubscriber($subscriber);

Event methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to our guidelines the headline should be "Event Methods"

~~~~~~~~~~~~~
Each workflow event is an instance of :class:`Symfony\\Component\\Workflow\\Event\\Event`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a blank line before the paragraph?

This means that each event has access to the following information:

:method:`Symfony\\Component\\Workflow\\Event\\Event::getMarking`
Returns the :class:`Symfony\\Component\\Workflow\\Marking` of the workflow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should end all descriptions with a dot


:method:`Symfony\\Component\\Worflow\\Event\\Event::getSubject`
Returns the object that dispatches the event.

:method:`Symfony\\Component\\Workflow\\Event\\Event::getTransition`
Returns the :class:`Symfony\\Component\\Workflow\\Transition` that dispatches the event

For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`. This class has two more methods:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a line break after the first sentence?


:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::isBlocked`
Returns if transition is blocked

:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::setBlocked`
Sets the blocked value



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one blank line is enough :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh Should I change something you mentioned above, or will it be done while merging?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever you prefer. :) If you like to do it yourself before we merge it, that'll be fine. Otherwise, it will be no problem to do so while merging.

Usage in Twig
-------------

Expand Down