Skip to content

Commit 9e0cc4c

Browse files
committed
minor #9233 hotfix: missing the call to InstanceOfSupportStrategy (Simperfit, javiereguiluz)
This PR was merged into the master branch. Discussion ---------- hotfix: missing the call to InstanceOfSupportStrategy Updating the exemple I missed the call to instanceOfSupportStrategy which is now needed. Commits ------- fbcf572 Added the use import 379a939 hotfix: missing the call to InstanceOfSupportStrategy
2 parents 30fdd17 + fbcf572 commit 9e0cc4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/workflow.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ A registry will also help you to decide if a workflow supports the object you
6363
are trying to use it with::
6464

6565
use Symfony\Component\Workflow\Registry;
66+
use Symfony\Component\Workflow\WorkflowInterface\InstanceOfSupportStrategy;
6667
use Acme\Entity\BlogPost;
6768
use Acme\Entity\Newsletter;
6869

6970
$blogWorkflow = ...
7071
$newsletterWorkflow = ...
7172

7273
$registry = new Registry();
73-
$registry->addWorkflow($blogWorkflow, BlogPost::class);
74-
$registry->addWorkflow($newsletterWorkflow, Newsletter::class);
74+
$registry->addWorkflow($blogWorkflow, new InstanceOfSupportStrategy(BlogPost::class));
75+
$registry->addWorkflow($newsletterWorkflow, new InstanceOfSupportStrategy(Newsletter::class));
7576
7677
.. versionadded:: 4.1
7778
The ``addWorkflow()`` method was introduced in Symfony 4.1. In previous

0 commit comments

Comments
 (0)