mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 12:33:17 +08:00
PERF: avoid reinstantiation of event subscribers
This commit is contained in:
parent
e536ea5d0d
commit
c5bb8bcf6c
|
@ -8,8 +8,8 @@ class AddClientAssets
|
|||
{
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(RegisterLocales::class, __CLASS__.'@addLocale');
|
||||
$events->listen(BuildClientView::class, __CLASS__.'@addAssets');
|
||||
$events->listen(RegisterLocales::class, [$this, 'addLocale']);
|
||||
$events->listen(BuildClientView::class, [$this, 'addAssets']);
|
||||
}
|
||||
|
||||
public function addLocale(RegisterLocales $event)
|
||||
|
|
|
@ -7,7 +7,7 @@ class AddEmoticons
|
|||
{
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(FormatterConfigurator::class, __CLASS__.'@addEmoticons');
|
||||
$events->listen(FormatterConfigurator::class, [$this, 'addEmoticons']);
|
||||
}
|
||||
|
||||
public function addEmoticons(FormatterConfigurator $event)
|
||||
|
|
Loading…
Reference in New Issue
Block a user