mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-16 18:01:38 +00:00
Fix EventDispatcer & events
Looks like parameter for the `->dispatch(` have been flipped (event first then event name). Define events should now extends `Symfony\Contracts\EventDispatcher\Event`
This commit is contained in:
parent
63bcf50ea7
commit
d47c208743
15 changed files with 30 additions and 48 deletions
|
@ -102,7 +102,7 @@ class EntryController extends Controller
|
|||
$entry->removeTag($tag);
|
||||
}
|
||||
} elseif ('delete' === $action) {
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(new EntryDeletedEvent($entry), EntryDeletedEvent::NAME);
|
||||
$em->remove($entry);
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ class EntryController extends Controller
|
|||
$em->flush();
|
||||
|
||||
// entry saved, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(new EntrySavedEvent($entry), EntrySavedEvent::NAME);
|
||||
|
||||
return $this->redirect($this->generateUrl('homepage'));
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ class EntryController extends Controller
|
|||
$em->flush();
|
||||
|
||||
// entry saved, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(new EntrySavedEvent($entry), EntrySavedEvent::NAME);
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('homepage'));
|
||||
|
@ -414,7 +414,7 @@ class EntryController extends Controller
|
|||
$em->flush();
|
||||
|
||||
// entry saved, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(new EntrySavedEvent($entry), EntrySavedEvent::NAME);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ class EntryController extends Controller
|
|||
);
|
||||
|
||||
// entry deleted, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(new EntryDeletedEvent($entry), EntryDeletedEvent::NAME);
|
||||
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($entry);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue