Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bb1017

Browse files
committed
fixup outdated early instantiation
1 parent f28e6ff commit 2bb1017

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Symfony/Component/Workflow/Workflow.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,14 @@ private function transition($subject, Transition $transition, Marking $marking)
254254

255255
private function enter($subject, Transition $transition, Marking $marking)
256256
{
257-
if (null !== $this->dispatcher) {
258-
$event = new Event($subject, $marking, $transition);
259-
}
260-
261257
$entered = array();
262258
foreach ($transition->getTos() as $place) {
263259
$marking->mark($place);
264260
$entered[] = $place;
265261
}
266262

267263
if (null !== $this->dispatcher) {
264+
$event = new Event($subject, $marking, $transition);
268265
$this->dispatcher->dispatch('workflow.enter', $event);
269266
$this->dispatcher->dispatch(sprintf('workflow.%s.enter', $this->name), $event);
270267

0 commit comments

Comments
 (0)