Skip to content

Commit fff04ec

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: [Mercure] Remove outdated authorization section [Workflow] Do not talk about registry
2 parents af7f5f9 + e7ff39e commit fff04ec

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

components/workflow.rst

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,33 +58,12 @@ The ``Workflow`` can now help you to decide what *transitions* (actions) are all
5858
on a blog post depending on what *place* (state) it is in. This will keep your domain
5959
logic in one place and not spread all over your application.
6060

61-
When you define multiple workflows you should consider using a ``Registry``,
62-
which is an object that stores and provides access to different workflows.
63-
A registry will also help you to decide if a workflow supports the object you
64-
are trying to use it with::
65-
66-
use Acme\Entity\BlogPost;
67-
use Acme\Entity\Newsletter;
68-
use Symfony\Component\Workflow\Registry;
69-
use Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy;
70-
71-
$blogPostWorkflow = ...;
72-
$newsletterWorkflow = ...;
73-
74-
$registry = new Registry();
75-
$registry->addWorkflow($blogPostWorkflow, new InstanceOfSupportStrategy(BlogPost::class));
76-
$registry->addWorkflow($newsletterWorkflow, new InstanceOfSupportStrategy(Newsletter::class));
77-
7861
Usage
7962
-----
8063

81-
When you have configured a ``Registry`` with your workflows,
82-
you can retrieve a workflow from it and use it as follows::
83-
8464
// ...
8565
// Consider that $blogPost is in place "draft" by default
8666
$blogPost = new BlogPost();
87-
$workflow = $registry->get($blogPost);
8867

8968
$workflow->can($blogPost, 'publish'); // False
9069
$workflow->can($blogPost, 'to_review'); // True
@@ -103,7 +82,6 @@ method to initialize the object property::
10382

10483
// ...
10584
$blogPost = new BlogPost();
106-
$workflow = $registry->get($blogPost);
10785

10886
// initiate workflow
10987
$workflow->getMarking($blogPost);

mercure.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,11 @@ MercureBundle provides a more advanced configuration:
193193
194194
{
195195
"mercure": {
196-
"publish": []
196+
"publish": ["*"]
197197
}
198198
}
199199
200-
Because the array is empty, the Symfony app will only be authorized to publish
201-
public updates (see the authorization_ section for further information).
202-
203-
The jwt.io website is a convenient way to create and sign JWTs.
204-
Checkout this `example JWT`_, that grants publishing rights for all *topics*
205-
(notice the star in the array).
200+
The jwt.io website is a convenient way to create and sign JWTs, checkout this `example JWT`_.
206201
Don't forget to set your secret key properly in the bottom of the right panel of the form!
207202

208203
Basic Usage

0 commit comments

Comments
 (0)