8000 [Workflow] config doc · symfony/symfony-docs@a640d14 · GitHub
[go: up one dir, main page]

Skip to content

Commit a640d14

Browse files
noniagriconomiewouterj
authored andcommitted
[Workflow] config doc
1 parent 7bb2041 commit a640d14

File tree

3 files changed

+57
-55
lines changed

3 files changed

+57
-55
lines changed

components/workflow.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ Usage
7979
-----
8080

8181
When you have configured a ``Registry`` with your workflows,
82-
you can retrieve a workflow from it and use it as follows::
82+
you can retreive a workflow from it and use it as follows::
8383

8484
// ...
8585
// Consider that $blogPost is in place "draft" by default
86+
// Consider that $post is in state "draft" by default
8687
$blogPost = new BlogPost();
8788
$workflow = $registry->get($blogPost);
8889

workflow.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ what actions are allowed on a blog post::
182182
use App\Entity\BlogPost;
183183
use Symfony\Component\Workflow\Exception\LogicException;
184184

185-
$post = BlogPost();
185+
$post = new BlogPost();
186186

187187
$workflow = $this->container->get('workflow.blog_publishing');
188188
$workflow->can($post, 'publish'); // False
@@ -664,6 +664,7 @@ Then you can access this metadata in your controller as follows::
664664

665665
use App\Entity\BlogPost;
666666
use Symfony\Component\Workflow\Registry;
667+
use App\Entity\BlogPost;
667668

668669
public function myController(Registry $registry, BlogPost $post)
669670
{

workflow/dumping-workflows.rst

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -228,63 +228,63 @@ Below is the configuration for the pull request state machine with styling added
228228
// ...
229229
'workflows' => [
230230
'pull_request' => [
231-
'type' => 'state_machine',
232-
'supports' => ['App\Entity\PullRequest'],
233-
'places' => [
234-
'start',
235-
'coding',
236-
'test',
237-
'review' => [
238-
'metadata' => [
239-
'description' => 'Human review',
231+
'type' => 'state_machine',
232+
'supports' => ['App\Entity\PullRequest'],
233+
'places' => [
234+
'start',
235+
'coding',
236+
'test',
237+
'review' => [
238+
'metadata' => [
239+
'description' => 'Human review',
240+
],
240241
],
241-
],
242-
'merged',
243-
'closed' => [
244-
'metadata' => [
245-
'bg_color' => 'DeepSkyBlue',
242+
'merged',
243+
'closed' => [
244+
'metadata' => [
245+
'bg_color' => 'DeepSkyBlue',
246+
],
246247
],
247248
],
248-
],
249-
'transitions' => [
250-
'submit'=> [
251-
'from' => 'start',
252-
'to' => 'test',
253-
],
254-
'update'=> [
255-
'from' => ['coding', 'test', 'review'],
256-
'to' => 'test',
257-
'metadata' => [
258-
'arrow_color' => 'Turquoise',
259-
],
260-
],
261-
'wait_for_review'=> [
262-
'from' => 'test',
263-
'to' => 'review',
264-
'metadata' => [
265-
'color' => 'Orange',
266-
],
267-
],
268-
'request_change'=> [
269-
'from' => 'review',
270-
'to' => 'coding',
271-
],
272-
'accept'=> [
273-
'from' => 'review',
274-
'to' => 'merged',
275-
'metadata' => [
276-
'label' => 'Accept PR',
277-
],
278-
],
279-
'reject'=> [
280-
'from' => 'review',
281-
'to' => 'closed',
282-
],
283-
'reopen'=> [
284-
'from' => 'start',
285-
'to' => 'review',
249+
'transitions' => [
250+
'submit'=> [
251+
'from' => 'start',
252+
'to' => 'test',
253+
],
254+
'update'=> [
255+
'from' => ['coding', 'test', 'review'],
256+
'to' => 'test',
257+
'metadata' => [
258+
'arrow_color' => 'Turquoise',
259+
],
260+
],
261+
'wait_for_review'=> [
262+
'from' => 'test',
263+
'to' => 'review',
264+
'metadata' => [
265+
'color' => 'Orange',
266+
],
267+
],
268+
'request_change'=> [
269+
'from' => 'review',
270+
'to' => 'coding',
271+
],
272+
'accept'=> [
273+
'from' => 'review',
274+
'to' => 'merged',
275+
'metadata' => [
276+
'label' => 'Accept PR',
277+
],
278+
],
279+
'reject'=> [
280+
'from' => 'review',
281+
'to' => 'closed',
282+
],
283+
'reopen'=> [
284+
'from' => 'start',
285+
'to' => 'review',
286+
],
286287
],
287-
],
288288
],
289289
],
290290
]);

0 commit comments

Comments
 (0)
0