From 379a939276355c4ca78843e039bd26860ab2e106 Mon Sep 17 00:00:00 2001 From: Hamza Amrouche Date: Fri, 9 Feb 2018 11:02:58 +0100 Subject: [PATCH 1/2] hotfix: missing the call to InstanceOfSupportStrategy --- components/workflow.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/workflow.rst b/components/workflow.rst index 39406afa1e4..bce4dc5ab7b 100644 --- a/components/workflow.rst +++ b/components/workflow.rst @@ -70,8 +70,8 @@ are trying to use it with:: $newsletterWorkflow = ... $registry = new Registry(); - $registry->addWorkflow($blogWorkflow, BlogPost::class); - $registry->addWorkflow($newsletterWorkflow, Newsletter::class); + $registry->addWorkflow($blogWorkflow, new InstanceOfSupportStrategy(BlogPost::class)); + $registry->addWorkflow($newsletterWorkflow, new InstanceOfSupportStrategy(Newsletter::class)); .. versionadded:: 4.1 The ``addWorkflow()`` method was introduced in Symfony 4.1. In previous From fbcf572be11cfe4bc057ff14964e9f1df7c67c8d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Feb 2018 13:19:17 +0100 Subject: [PATCH 2/2] Added the use import --- components/workflow.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/workflow.rst b/components/workflow.rst index bce4dc5ab7b..8a0daf1f7fb 100644 --- a/components/workflow.rst +++ b/components/workflow.rst @@ -63,6 +63,7 @@ A registry will also help you to decide if a workflow supports the object you are trying to use it with:: use Symfony\Component\Workflow\Registry; + use Symfony\Component\Workflow\WorkflowInterface\InstanceOfSupportStrategy; use Acme\Entity\BlogPost; use Acme\Entity\Newsletter;