From b24acb0579a26e0da68b0125a7ef6fe0d009bc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 4 Jul 2018 18:09:16 +0200 Subject: [PATCH] [Workflow] Fixed BC break --- src/Symfony/Component/Workflow/Event/Event.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Workflow/Event/Event.php b/src/Symfony/Component/Workflow/Event/Event.php index a9e2086968..f77a20f778 100644 --- a/src/Symfony/Component/Workflow/Event/Event.php +++ b/src/Symfony/Component/Workflow/Event/Event.php @@ -40,7 +40,10 @@ class Event extends BaseEvent $this->subject = $subject; $this->marking = $marking; $this->transition = $transition; - if (is_string($workflow)) { + if (null === $workflow) { + @trigger_error(sprintf('Passing only three parameters to "%s" is deprecated since Symfony 4.1. Pass a %s instance as fourth parameter instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); + $this->workflowName = 'unnamed'; + } elseif (is_string($workflow)) { @trigger_error(sprintf('Passing a string as 4th parameter of "%s" is deprecated since Symfony 4.1. Pass a %s instance instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED); $this->workflowName = $workflow; } elseif ($workflow instanceof WorkflowInterface) {