mirror of
https://github.com/flarum/framework.git
synced 2025-01-24 13:02:01 +08:00
PERF: avoid reinstantiation of event subscribers
This commit is contained in:
parent
c4b32f1326
commit
608d4a1a47
|
@ -7,7 +7,7 @@ class AddBBCodeFormatter
|
|||
{
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(FormatterConfigurator::class, __CLASS__.'@addBBCodeFormatter');
|
||||
$events->listen(FormatterConfigurator::class, [$this, 'addBBCodeFormatter']);
|
||||
}
|
||||
|
||||
public function addBBCodeFormatter(FormatterConfigurator $event)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user