mirror of
https://github.com/flarum/core.git
synced 2025-07-18 23:31: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
|
// Also set up an event listener to flush the formatter cache whenever
|
||||||
// this extension is enabled or disabled.
|
// this extension is enabled or disabled.
|
||||||
$flush = function ($event) use ($container, $extension) {
|
$events->listen(
|
||||||
if ($event->extension === $extension) {
|
[Enabled::class, Disabled::class],
|
||||||
$container->make(ActualFormatter::class)->flush();
|
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