Skip to content

Commit d40fed9

Browse files
bug symfony#27848 [Workflow] Fixed BC break (lyrixx)
This PR was merged into the 4.1 branch. Discussion ---------- [Workflow] Fixed BC break | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#27759 | License | MIT | Doc PR | Commits ------- b24acb0 [Workflow] Fixed BC break
2 parents e308c93 + b24acb0 commit d40fed9

File tree

1 file changed

+4
-1
lines changed
  • src/Symfony/Component/Workflow/Event

1 file changed

+4
-1
lines changed

src/Symfony/Component/Workflow/Event/Event.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ public function __construct($subject, Marking $marking, Transition $transition,
4040
$this->subject = $subject;
4141
$this->marking = $marking;
4242
$this->transition = $transition;
43-
if (is_string($workflow)) {
43+
if (null === $workflow) {
44+
@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);
45+
$this->workflowName = 'unnamed';
46+
} elseif (is_string($workflow)) {
4447
@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);
4548
$this->workflowName = $workflow;
4649
} elseif ($workflow instanceof WorkflowInterface) {

0 commit comments

Comments
 (0)