mirror of
https://github.com/flarum/core.git
synced 2025-07-18 07:11:17 +02:00
Merge event listener registration
This commit is contained in:
committed by
Franz Liedke
parent
22c911476b
commit
ca28f0ca45
@@ -43,13 +43,13 @@ class Formatter implements ExtenderInterface
|
||||
|
||||
// Also set up an event listener to flush the formatter cache whenever
|
||||
// this extension is enabled or disabled.
|
||||
$flush = function ($event) use ($container, $extension) {
|
||||
if ($event->extension === $extension) {
|
||||
$container->make(ActualFormatter::class)->flush();
|
||||
$events->listen(
|
||||
[Enabled::class, Disabled::class],
|
||||
function ($event) use ($container, $extension) {
|
||||
if ($event->extension === $extension) {
|
||||
$container->make(ActualFormatter::class)->flush();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$events->listen(Enabled::class, $flush);
|
||||
$events->listen(Disabled::class, $flush);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user