bug #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 | #27759
| License       | MIT
| Doc PR        |

Commits
-------

b24acb0579 [Workflow] Fixed BC break
This commit is contained in:
Nicolas Grekas 2018-07-05 14:56:41 +02:00
commit d40fed9253

View File

@ -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) {