Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Workflow] Fix code blocks using an enum#21499
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -361,11 +361,11 @@ | ||
| <framework:config> | ||
| <!-- or type="state_machine" --> | ||
| <framework:workflow name="blog_publishing" type="workflow" places="App\Enumeration\BlogPostStatus::*"> | ||
| <framework:initial-marking>draft</framework:initial-marking> | ||
ContributorAuthor
| ||
| <framework:marking-store type="method"> | ||
| <framework:argument>status</framework:argument> | ||
| </framework:marking-store> | ||
| <framework:support>App\Entity\BlogPost</framework:support> | ||
| <framework:transition name="to_review"> | ||
| <framework:from>draft</framework:from> | ||
| @@ -391,33 +391,36 @@ | ||
| use Symfony\Config\FrameworkConfig; | ||
| return static function (FrameworkConfig $framework): void { | ||
| $blogPublishing = $framework->workflows()->workflow('blog_publishing'); | ||
| $blogPublishing | ||
| ->type('workflow') | ||
| ->supports([BlogPost::class]) | ||
| ->initialMarking([BlogPostStatus::Draft->value]); | ||
| $blogPublishing->markingStore() | ||
| ->type('method') | ||
| ->property('status'); | ||
| $blogPublishing->place(BlogPostStatus::Draft->value); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. this isnot the equivalent of the Yaml code snippet, which references the enum itself instead of registering each case separately. The equivalent of the Yaml snippet would be ContributorAuthor
| ||
| $blogPublishing->place(BlogPostStatus::Reviewed->value); | ||
| $blogPublishing->place(BlogPostStatus::Published->value); | ||
| $blogPublishing->place(BlogPostStatus::Rejected->value); | ||
| $blogPublishing->transition() | ||
| ->name('to_review') | ||
| ->from([BlogPostStatus::Draft->value]) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. is this really needed ? The Yaml code snippet uses the enum case, not the value. ContributorAuthor
| ||
| ->to([BlogPostStatus::Reviewed->value]); | ||
| $blogPublishing->transition() | ||
| ->name('publish') | ||
| ->from([BlogPostStatus::Reviewed->value]) | ||
| ->to([BlogPostStatus::Published->value]); | ||
| $blogPublishing->transition() | ||
| ->name('reject') | ||
| ->from([BlogPostStatus::Reviewed->value]) | ||
| ->to([BlogPostStatus::Rejected->value]); | ||
| }; | ||
| The component will now transparently cast the enum to its backing value | ||
| when needed and vice-versa when working with your objects:: | ||
Uh oh!
There was an error while loading.Please reload this page.