-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Improvements to Workflow documentation #10757
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
Conversation
|
||
Component does also support state machines. A state machine is a subset | ||
of a workflow and its purpose is to hold a state of your model. Read more about the | ||
differences and specific features of state machine in :doc:`/workflow/state-machines`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be usefull to explain why a developer should/must/can use this component inside its project.
With a sentence like : Use case: if in your project you are using a $status on an object, with notions of progression/validation, this component can be a solid foundation/wrapper.
wdyt?
@@ -1,477 +0,0 @@ | |||
.. index:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by removing this file, can you just see this one ?
https://github.com/symfony/symfony-docs/pull/10751/files
do you think we can merge both PR together?
@jzawadzki there are some nice doc code here, are you going to finish this PR? |
use Symfony\Component\Workflow\Registry; | ||
use App\Entity\BlogPost; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\Workflow\Exception\TransitionException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use ordered use statements
} | ||
} | ||
|
||
.. versionadded:: 4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a blankline after the versionadded directive
The :class:`Symfony\\Component\\Workflow\\Exception\\TransitionException` | ||
class was introduced in Symfony 4.1. | ||
|
||
.. versionadded:: 4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a blankline after the versionadded directive
@@ -12,8 +12,6 @@ Use the ``GraphvizDumper`` or ``StateMachineGraphvizDumper`` to create DOT | |||
files, or use ``PlantUmlDumper`` for PlantUML files. Both types can be converted | |||
to PNG or SVG images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to PNG or SVG images. | |
to PNG or SVG images:: |
@@ -12,8 +12,6 @@ Use the ``GraphvizDumper`` or ``StateMachineGraphvizDumper`` to create DOT | |||
files, or use ``PlantUmlDumper`` for PlantUML files. Both types can be converted | |||
to PNG or SVG images. | |||
|
|||
Images of the workflow defined above: | |||
|
|||
.. code-block:: php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. code-block:: php |
See example to make sure no blog post without title is moved to "review":: | ||
|
||
use Symfony\Component\Workflow\Event\GuardEvent; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ordered use statements
{ | ||
public function guardReview(GuardEvent $event) | ||
{ | ||
/** @var \App\Entity\BlogPost $post */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** @var \App\Entity\BlogPost $post */ | |
/** @var App\Entity\BlogPost $post */ |
@jzawadzki is it possible for you to finish / rewrite this one based on last code version? |
hi @noniagriconomie - yes, will update it tomorrow |
Most of the doc in this PR is already merged. |
I'm really sorry that we didn't merge this on time and I apologize for that. Sadly, since this pull request stalled, we merged many other related pull requests which implemented all these changes, so we must close this one without merging it. I'm sorry. |
Pull request that tries to implement ideas described in #10747
Marked as WIP as it's definitely not final version, but it's ready for first reviews
#SymfonyConHackDay2018