@@ -122,39 +122,39 @@ like this:
122
122
123
123
// config/packages/workflow.php
124
124
125
- $container->loadFromExtension('framework', array(
125
+ $container->loadFromExtension('framework', [
126
126
// ...
127
- 'workflows' => array(
128
- 'blog_publishing' => array(
127
+ 'workflows' => [
128
+ 'blog_publishing' => [
129
129
'type' => 'workflow', // or 'state_machine'
130
- 'marking_store' => array(
130
+ 'marking_store' => [
131
131
'type' => 'multiple_state', // or 'single_state'
132
- 'arguments' => array( 'currentPlace')
133
- ) ,
134
- 'supports' => array( 'App\Entity\BlogPost') ,
135
- 'places' => array(
132
+ 'arguments' => [ 'currentPlace']
133
+ ] ,
134
+ 'supports' => [ 'App\Entity\BlogPost'] ,
135
+ 'places' => [
136
136
'draft',
137
137
'review',
138
138
'rejected',
139
139
'published',
140
- ) ,
141
- 'transitions' => array(
142
- 'to_review' => array(
140
+ ] ,
141
+ 'transitions' => [
142
+ 'to_review' => [
143
143
'from' => 'draft',
144
144
'to' => 'review',
145
- ) ,
146
- 'publish' => array(
147
- 'from' => 'review',
148
- 'to' => 'published',
149
- ) ,
150
- 'reject' => array(
151
- 'from' => 'review',
152
- 'to' => 'rejected',
153
- ) ,
154
- ) ,
155
- ) ,
156
- ) ,
157
- ) );
145
+ ] ,
146
+ 'publish' => [
147
+ 'from' => 'review',
148
+ 'to' => 'published',
149
+ ] ,
150
+ 'reject' => [
151
+ 'from' => 'review',
152
+ 'to' => 'rejected',
153
+ ] ,
154
+ ] ,
155
+ ] ,
156
+ ] ,
157
+ ] );
158
158
159
159
.. code-block :: php
160
160
@@ -335,9 +335,9 @@ workflow leaves a place::
335
335
336
336
public static function getSubscribedEvents()
337
337
{
338
- return array(
338
+ return [
339
339
'workflow.blog_publishing.leave' => 'onLeave',
340
- ) ;
340
+ ] ;
341
341
}
342
342
}
343
343
@@ -377,9 +377,9 @@ See example to make sure no blog post without title is moved to "review"::
377
377
378
378
public static function getSubscribedEvents()
379
379
{
380
- return array(
381
- 'workflow.blogpost.guard.to_review' => array( 'guardReview') ,
382
- ) ;
380
+ return [
381
+ 'workflow.blogpost.guard.to_review' => [ 'guardReview'] ,
382
+ ] ;
383
383
}
384
384
}
385
385
@@ -537,34 +537,34 @@ requires:
537
537
538
538
// config/packages/workflow.php
539
539
540
- $container->loadFromExtension('framework', array(
540
+ $container->loadFromExtension('framework', [
541
+ // ...
542
+ 'workflows' => [
543
+ 'blog_publishing' => [
544
+ 'metadata' => [
545
+ 'title' => 'Blog Publishing Workflow',
546
+ ],
541
547
// ...
542
- 'workflows' => array(
543
- 'blog_publishing' => array(
544
- 'metadata' => array(
545
- 'title' => 'Blog Publishing Workflow',
546
- ),
547
- // ...
548
- 'places' => array(
549
- 'draft' => array(
550
- 'metadata' => array(
551
- 'max_num_of_words' => 500,
552
- ),
553
- ),
554
- // ...
555
- ),
556
- 'transitions' => array(
557
- 'to_review' => array(
558
- 'from' => 'draft',
559
- 'to' => 'review',
560
- 'metadata' => array(
561
- 'priority' => 0.5,
562
- ),
563
- ),
564
- ),
565
- ),
566
- ),
567
- ));
548
+ 'places' => [
549
+ 'draft' => [
550
+ 'metadata' => [
551
+ 'max_num_of_words' => 500,
552
+ ],
553
+ ],
554
+ // ...
555
+ ],
556
+ 'transitions' => [
557
+ 'to_review' => [
558
+ 'from' => 'draft',
559
+ 'to' => 'review',
560
+ 'metadata' => [
561
+ 'priority' => 0.5,
562
+ ],
563
+ ],
564
+ ],
565
+ ],
566
+ ],
567
+ ]);
568
568
569
569
Then you can access this metadata in your controller as follows::
570
570
0 commit comments