Skip to content

Commit 6238972

Browse files
committed
Update arrays to use short syntax
1 parent a582e1c commit 6238972

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

workflow/usage.rst

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -122,39 +122,39 @@ like this:
122122
123123
// config/packages/workflow.php
124124
125-
$container->loadFromExtension('framework', array(
125+
$container->loadFromExtension('framework', [
126126
// ...
127-
'workflows' => array(
128-
'blog_publishing' => array(
127+
'workflows' => [
128+
'blog_publishing' => [
129129
'type' => 'workflow', // or 'state_machine'
130-
'marking_store' => array(
130+
'marking_store' => [
131131
'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' => [
136136
'draft',
137137
'review',
138138
'rejected',
139139
'published',
140-
),
141-
'transitions' => array(
142-
'to_review' => array(
140+
],
141+
'transitions' => [
142+
'to_review' => [
143143
'from' => 'draft',
144144
'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+
]);
158158
159159
.. code-block:: php
160160
@@ -335,9 +335,9 @@ workflow leaves a place::
335335

336336
public static function getSubscribedEvents()
337337
{
338-
return array(
338+
return [
339339
'workflow.blog_publishing.leave' => 'onLeave',
340-
);
340+
];
341341
}
342342
}
343343

@@ -377,9 +377,9 @@ See example to make sure no blog post without title is moved to "review"::
377377

378378
public static function getSubscribedEvents()
379379
{
380-
return array(
381-
'workflow.blogpost.guard.to_review' => array('guardReview'),
382-
);
380+
return [
381+
'workflow.blogpost.guard.to_review' => ['guardReview'],
382+
];
383383
}
384384
}
385385

@@ -537,34 +537,34 @@ requires:
537537
538538
// config/packages/workflow.php
539539
540-
$container->loadFromExtension('framework', array(
540+
$container->loadFromExtension('framework', [
541+
// ...
542+
'workflows' => [
543+
'blog_publishing' => [
544+
'metadata' => [
545+
'title' => 'Blog Publishing Workflow',
546+
],
541547
// ...
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+
]);
568568

569569
Then you can access this metadata in your controller as follows::
570570

0 commit comments

Comments
 (0)